{"name":"pogo","version":"0.9.4","description":"A readable, DSL friendly programming language that compiles to JavaScript","author":{"name":"Tim Macfarlane","email":"timmacfarlane@gmail.com"},"repository":{"type":"git","url":"https://github.com/featurist/pogoscript.git"},"files":["index.js","pogo.js","lib","bin"],"scripts":{"test":"mocha --invert --grep @wip test/*Spec.* test/*/*Spec.*"},"bin":{"pogo":"bin/pogo"},"main":"index.js","devDependencies":{"bluebird":"~2.2.1","browserify":"","chai":"^1.9.1","glob":"","install":"~0.1.7","jison":"","mocha":"^1.18.2","pogoify":"0.0.3"},"bugs":{"url":"https://github.com/featurist/pogoscript/issues"},"dependencies":{"source-map":"~0.1.31","uglify-js":"~2.4.13","underscore":"1.4.4"},"peerDependencies":{"bluebird":"~2.2.1"},"keywords":["language","pogo"],"license":"BSD-2-Clause","browser":"lib/parser/compiler.js","homepage":"https://github.com/featurist/pogoscript","_id":"pogo@0.9.4","_shasum":"712d711cc446cd6f31b9c38f6cfde5910e41f526","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"refractalize","email":"timmacfarlane@gmail.com"},"maintainers":[{"name":"refractalize","email":"timmacfarlane@gmail.com"}],"dist":{"shasum":"712d711cc446cd6f31b9c38f6cfde5910e41f526","tarball":"http://registry-npm.ywwl.com/pogo/download/pogo-0.9.4.tgz","integrity":"sha512-SYvWkdbM5Z2/FBXj5HJD1uBk7YNm4V638SjXyaPz7pZdXML56hD4Yz6Bh3ecsl0vSV/F4kqgSNGwdYhhEcBIjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv+YRpbN6ALjJaBxEUQqCpvjeSxMOHaGBgyXioj5LZkgIhAMNjSTQHyqNiSkcVbNRY+5zm3Q3NvDxxvMb2TOlZS31J"}],"size":176487,"noattachment":false,"key":"/pogo/-/pogo-0.9.4.tgz"},"directories":{},"readme":"# Whaa?\n\nPogoscript is a programming language that emphasises readability, is friendly to domain specific languages and compiles to regular Javascript.\n\n[![travis-ci](https://secure.travis-ci.org/featurist/pogoscript.png?branch=master)](https://travis-ci.org/featurist/pogoscript)\n\n[![NPM version](https://badge.fury.io/js/pogo.png)](http://badge.fury.io/js/pogo)\n\n[![NPM dependencies](https://david-dm.org/featurist/pogoscript.png)](https://david-dm.org/featurist/pogoscript)\n\n# Installation\n\nPogoscript requires [node.js](http://nodejs.org/) and [npm](http://npmjs.org/).\n\n    npm install -g pogo\n\nOr to install local to your project:\n\n    npm install pogo\n\n# Usage\n\n## Interactive Prompt\n\n    pogo\n\n## Executing a Script\n\n    pogo helloWorld.pogo\n\n## Debugging a Script\n\nAll the regular `node` [debugging invocations](http://nodejs.org/api/debugger.html) work:\n\nTo invoke the node debugger:\n\n\tpogo debug helloWorld.pogo\n\nTo allow remote debugging, e.g. with [node-inspector](https://github.com/dannycoates/node-inspector):\n\n\tpogo --debug helloWorld.pogo\n\nIf you want to break on the first line:\n\n\tpogo --debug-brk helloWorld.pogo\n\nYou can also put breakpoints in your source code, just put `debugger` on its own line:\n\n\tsomeFunction ()\n\tdebugger\n\tsomeOtherFunction ()\n\n## Compiling a Script\n\n    pogo -c helloWorld.pogo\n\nWill produce `helloWorld.js`.\n\n## Watching and Compiling\n\n    pogo -cw helloWorld.pogo\n\n# Examples!\n\nThe canonical [Node.js](http://nodejs.org/) hello world:\n\n    http = require 'http'\n\n    http.createServer @(req, res)\n        res.writeHead 200 ('Content-Type': 'text/plain')\n        res.end \"Hello World\\n\"\n    .listen 1337 \"127.0.0.1\"\n\n    console.log 'Server running at http://127.0.0.1:1337/'\n\nThe canonical [99 beers on the wall](http://99-bottles-of-beer.net/):\n\n    sing (n) bottlesOfBeerOnTheWall =\n        if (n > 0)\n            console.log ((n) bottlesOfBeerOnTheWall)\n            sing (n - 1) bottlesOfBeerOnTheWall\n\n    (n) bottlesOfBeerOnTheWall =\n        \"#((n) bottles) of beer on the wall, #((n) bottles) of beer.\\n\" +\n        \"Take one down, pass it around, #((n - 1) bottles) of beer on the wall.\"\n\n    (n) bottles =\n        if (n == 0)\n            \"no bottles\"\n        else if (n == 1)\n            \"1 bottle\"\n        else\n            \"#(n) bottles\"\n\n    sing 99 bottlesOfBeerOnTheWall\n\n# The Big Features\n\n## Arguments and Parameters\n\nArguments and parameters can be placed anywhere in the name of a function or method call. The careful placement of an argument or a parameter can give it a lot of meaning.\n\n    mountains = ['Everest', 'La Tournette', 'Valuga']\n\n    for each @(mountain) in (mountains)\n        console.log (mountain)\n\n## Blocks\n\nBlocks are just indented code:\n\n    after (duration, doSomething) =\n        setTimeout (doSomething, duration)\n    \n    (n) seconds =\n        n * 1000\n    \n    after (10 seconds)\n        console.log \"hi there!\"\n\n## Self\n\nThe `self` variable, also known as `this` in JavaScript, is retained from a block's outer context:\n\n    jack = {\n        name = \"Jack\"\n        \n        sayHello () =\n            console.log \"hi, my name is #(self.name)\"\n            \n            after (10 seconds)\n                console.log \"hi! this is #(self.name) again.\"\n    }\n    \n    jack.sayHello ()\n\nBut if you want and expect `self` to be redefined to something useful, put `=>` before the block like so:\n\n    onEachHttpRequest (action, port: 3000) =\n        server = http.createServer @(request, response)\n            requestContext = {\n                request = request\n                response = response\n            }\n            \n            action.call (requestContext)\n            \n        server.listen (port)\n    \n    onEachHttpRequest =>\n        self.response.end \"Hello World\\n\"\n\n## Optional Arguments\n\nMethods and functions can take optional arguments, in the form of a hash passed as the last argument.\n\n    webServer (port: 4567) =\n        console.log \"starting web server on port #(port)\"\n    \n    webServer ()\n    \n    webServer (port: 3000)\n\n## No Built-in Keywords\n\nThere are no keywords in PogoScript. All control structures use the same syntax rules as regular functions and methods, so it's very easy to write your own control structures:\n\n    unless (condition, block) =\n        if (!condition)\n            block ()\n    \n    unless (windSpeed > 25)\n        console.log \"going surfing\"\n\nWhat about a multi-line control structure?\n\n    renderEachIn (list, render) ifNone (none) =\n        if (list.length > 0)\n            content = ''\n\n            for each @(item) in (items)\n                content := content + render (item)\n\n            content\n        else\n            none ()\n\n    mountains = ['Everest', 'La Tournette', 'Valuga']\n\n    renderEach @(mountain) in (mountains)\n        \"<li>#(mountain)</li>\"\n    ifNone\n        \"<li>no mountains...</li>\"\n\n\n# More\n\n[joshski](http://github.com/joshski) has put together a page showing [how PogoScript translates into JavaScript](http://featurist.github.com/pogo-examples). You can examine the [cheatsheet](http://pogoscript.org/cheatsheet.html), or head to the [home page](http://pogoscript.org/) page.\n","publish_time":1407429007497,"_cnpm_publish_time":1407429007497,"dist-tags":{"latest":"0.10.0"}}