{"_id":"generic-function","_rev":"11-6edc5d96f934b6b8a9493d0b10ca04ff","name":"generic-function","description":"A generic function implementation for node.js with CLOS-like (Common Lisp Object System) syntax.","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"generic-function","version":"0.0.1","description":"A generic function implementation for node.js based on CLOS.","keywords":["generic","function","common","lisp","object","system"],"homepage":"http://github.com/ceineke/node-generic-function","author":{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"},"repositories":{"type":"git","url":"https://github.com/ceineke/node-generic-function.git"},"main":"./lib/generic-function","engines":{"node":"*"},"_npmJsonOpts":{"file":"/home/ceineke/.npm/generic-function/0.0.1/package/package.json","wscript":false,"serverjs":false,"contributors":["Chris Eineke <chris@chriseineke.com> (http://chriseineke.com/)"]},"_id":"generic-function@0.0.1","contributors":[{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"}],"dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"0b5166e1919f11f530958ef9a31c98f72d364fd4","tarball":"https://registry.npmjs.org/generic-function/-/generic-function-0.0.1.tgz","integrity":"sha512-YkzolPBED8wlcLGezPwGckiJg2PhgXAIkTILW7++YVD223WeYdFJQWuMtFiJxBUeBbG7MY2qiPMdF6oUZ+wKpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCtf6pD9P63dXVst0oKsUY5AeU+pjixnTbyA3Vzh9dHwIgVEY4fKZvBgGQ4823iabKEyfGZ06EdiVy0ioo8KB6OQw="}]},"maintainers":[{"name":"ceineke","email":"npm@chriseineke.com"}]},"0.0.2":{"name":"generic-function","version":"0.0.2","description":"A generic function implementation for node.js based on CLOS.","keywords":["generic","function","common","lisp","object","system"],"homepage":"http://github.com/ceineke/node-generic-function","author":{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"},"repositories":{"type":"git","url":"https://github.com/ceineke/node-generic-function.git"},"main":"./lib/generic-function","engines":{"node":"*"},"_npmJsonOpts":{"file":"/home/ceineke/.npm/generic-function/0.0.2/package/package.json","wscript":false,"serverjs":false,"contributors":["Chris Eineke <chris@chriseineke.com> (http://chriseineke.com/)"]},"_id":"generic-function@0.0.2","contributors":[{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"}],"dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"2bb01ead2f59eb990eeccbbaba1d510a1a9d8a0b","tarball":"https://registry.npmjs.org/generic-function/-/generic-function-0.0.2.tgz","integrity":"sha512-L+YJeuBNnp5yO7Sbzi9q/NQ2HUkSzXg+8g7bKxCA6wLsowo7kRKRbICvumugZDrs0c4rQYqlg+LIxCIBx0clpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH2Esg0jncHtk3SiBMJGhXB8xT8ztv8A090UKy4v7VSAIhAMuf3bbwxfz6jghGqh5k01HjiSVhvgwsLxYT3q67Te+3"}]},"maintainers":[{"name":"ceineke","email":"npm@chriseineke.com"}]},"0.1.0":{"name":"generic-function","version":"0.1.0","description":"A generic function implementation for node.js with CLOS-like (Common Lisp Object System) syntax.","keywords":["generic","function","multi","multi-dispatch","multi-method","dispatch","method","common","lisp","object","system","clos"],"homepage":"http://github.com/ceineke/node-generic-function","author":{"name":"Chris Eineke","email":"github@ei.ne.ke","url":"http://ei.ne.ke/"},"repositories":{"type":"git","url":"https://github.com/ceineke/node-generic-function.git"},"dependencies":{},"devDependencies":{"nodeunit":"*"},"main":"lib/generic-function.js","engines":{"node":"*"},"contributors":[{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"}],"_id":"generic-function@0.1.0","dist":{"shasum":"20eab5e01e0862287cc49e98cbbc728d44b1e4c1","tarball":"https://registry.npmjs.org/generic-function/-/generic-function-0.1.0.tgz","integrity":"sha512-fkUROy8oy6kpAurAzFjSmrnjyyCkoJrjscSmygx2sDmDVPUGhaCK6RlnBlH+zaX7OYyxwfZg/mOq3JEZn/vspg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKClIKvLeINzTP4liG4TDyj+YdW/hfkNHYiBlbW2BK5gIhAN7pTEFCPTzvMGvVnXS08z0p3+7zPynDpd6GEqHU//8A"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"ceineke","email":"chris@chriseineke.com"},"maintainers":[{"name":"ceineke","email":"npm@chriseineke.com"}]},"0.1.1":{"name":"generic-function","version":"0.1.1","description":"A generic function implementation for node.js with CLOS-like (Common Lisp Object System) syntax.","keywords":["generic","function","multi","multi-dispatch","multi-method","dispatch","method","common","lisp","object","system","clos"],"homepage":"http://github.com/ceineke/node-generic-function","author":{"name":"Chris Eineke","email":"github@ei.ne.ke","url":"http://ei.ne.ke/"},"repositories":{"type":"git","url":"https://github.com/ceineke/node-generic-function.git"},"dependencies":{},"devDependencies":{"nodeunit":"*"},"main":"lib/generic-function.js","engines":{"node":"*"},"_id":"generic-function@0.1.1","dist":{"shasum":"4a000766271bb1f3d6c7a936f16197ad9016779e","tarball":"https://registry.npmjs.org/generic-function/-/generic-function-0.1.1.tgz","integrity":"sha512-B9ZPYohHtJq/deVQQpRvpiuVgieCbr35HE/2cjpQnmtG4J/7Cb4X/koYRAWO7jBaCKqhWiMGkQIWZifV/67Hbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTtLtKbE9wFstIqVRw6aj6ac2hdvTLdAGXEBlXBxlKTAIhAPhdUfYU5RYNJLsXyHAo/kZX9fn5aG9hKSwmfdLPIsA/"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"ceineke","email":"chris@chriseineke.com"},"maintainers":[{"name":"ceineke","email":"npm@chriseineke.com"}]}},"maintainers":[{"name":"ceineke","email":"npm@chriseineke.com"}],"time":{"modified":"2022-06-18T07:27:16.923Z","created":"2011-09-12T23:23:00.999Z","0.0.1":"2011-09-12T23:23:01.634Z","0.0.2":"2011-09-17T05:43:02.961Z","0.1.0":"2014-02-11T02:19:26.359Z","0.1.1":"2014-02-11T04:08:10.225Z"},"author":{"name":"Chris Eineke","email":"chris@chriseineke.com","url":"http://chriseineke.com/"},"readme":"# Generic Functions for Node.js #\n\n## 1. Overview ##\nGeneric Functions for Node.js is an implementation of <a href=\"http://en.wikipedia.org/wiki/Generic_function\">generic\nfunctions</a> for Node.js, based on the Common Lisp Object System.\n\nHere's the run-down. A generic function is a callable function that dispatches to different specializations (\"methods\")\nfor different parameters. Primitive object-oriented systems use single dispatch dispatch only the first argument\n(usually the first one left to the dot) whereas advanced ones dispatch on all their arguments (which makes dot notation\nunnecessary).\n\n## 2. Example ##\n\trequire(\"generic-function\");\n\n\tvar collide = defgeneric(2);\n\tdefmethod(collide, \"string\", \"number\", function (x, y) {\n\t\tconsole.log(\"A %s collided with %s pieces of asteriods.\", x, y);\n\t});\n\tdefmethod(collide, \"number\", \"string\", function (x, y) {\n\t\tconsole.log(\"%s pieces of asteroids collided with a %s.\", x, y);\n\t});\n\tcollide(\"spaceship\", 42);\n\t\"A spaceship collided with 42 pieces of asteriods.\"\n\tcollide(23, \"space station\");\n\t\"23 pieces of asteroids collided with a space station.\"\n\n## 3. Supported Functionality ##\n- Core dispatch functionality (but without walking the prototype hierarchy yet)\n- Adding methods at any time\n- Removing methods at any time\n- Finding a method with a particular type signature\n\n## 4. Open Questions ##\n- Should intrinsic types be dispatched like their object-based counterparts? I.e., should 'string' be dispatched as a 'String' and vice-versa?\n- Method dispatch examines leaf object types, but not the prototype hierarchy. Walk the prototype hierarchy to find the matching method.\n- Support 0-arg generic functions.\n","readmeFilename":"README.md"}