{"_id":"oppo","_rev":"15-7939f848dd49374e794ec85d5dfccb7d","name":"oppo","dist-tags":{"latest":"0.1.3"},"versions":{"0.0.1":{"name":"oppo","description":"A lisp for javascript","keywords":["lisp","functional programming","fp","parser","compiler","jison"],"version":"0.0.1","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"dependencies":{"underscore":"1.x.x"},"devDependencies":{"coffee-script":"1.x.x"},"engines":{"node":"<0.5.0"},"preferGlobal":true,"_npmUser":{"name":"benekastah","email":"benekastah@gmail.com"},"_id":"oppo@0.0.1","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5e68d725af0915714811648d868ad6195a399b85","tarball":"https://registry.npmjs.org/oppo/-/oppo-0.0.1.tgz","integrity":"sha512-2J5eyHXUz2QlouIMi1syeaqsdF6pAm5aDnjaThktmNEMqjAKEDkelvUre1IkjEWkTZQzuvHcwzDeIh2RGv1lKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0fpzVB97YFwMJyph52cH/zqMTg4ANS/JW5A81hVBBVAiBHG1GTZI4o27hKujfvNdUeCyZ2djw564JFX8coVDMDgw=="}]},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"deprecated":"This package doesn't really work and was just an educational exercise. It shouldn't really be on npm, but since it seems to be getting downloaded I'll leave it up. Bottom line, if you want this to work for you, you should probably just fork the project."},"0.1.0":{"name":"oppo","description":"A lisp for javascript","keywords":["lisp","functional programming","fp","parser","compiler"],"version":"0.1.0","main":"dist/oppo.js","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"bin":{"oppo":"./bin/oppo"},"scripts":{"preinstall":"bin/npm-preinstall"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"dependencies":{"optimist":"0.2.x","uglify-js":"*","uglify-js2":"*"},"optionalDependencies":{"uglify-js":"*","uglify-js2":"*"},"devDependencies":{"coffee-script":"1.x.x"},"engines":{"node":"0.8.x"},"preferGlobal":true,"_id":"oppo@0.1.0","dist":{"shasum":"47672fb21e698a60f65e0e46f5fddae4c452d20b","tarball":"https://registry.npmjs.org/oppo/-/oppo-0.1.0.tgz","integrity":"sha512-NajTsy3V1NzmdyZABtH915UOpWQH3IVCJKIRxikdGNdU7Uo3wQt0O34c/EvaD6VQ4p3uEkm13+IIPePuLzh2og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+GF5MuM0NXeQrKEK2EFYYZ5YGNHoWnQzsSqd9SeXklAiEAm3PSttoksWCb+qwMjXnwSJe/EXe+sFDu5Fy6y4COGDs="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"benekastah","email":"benekastah@gmail.com"},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"deprecated":"This package doesn't really work and was just an educational exercise. It shouldn't really be on npm, but since it seems to be getting downloaded I'll leave it up. Bottom line, if you want this to work for you, you should probably just fork the project."},"0.1.1":{"name":"oppo","description":"A lisp for javascript","keywords":["lisp","functional programming","fp","parser","compiler"],"version":"0.1.1","main":"dist/oppo.js","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"bin":{"oppo":"./bin/oppo"},"scripts":{"preinstall":"bin/build"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"dependencies":{"optimist":"0.2.x","uglify-js":"*","uglify-js2":"*"},"optionalDependencies":{"uglify-js":"*","uglify-js2":"*"},"devDependencies":{"coffee-script":"1.x.x"},"engines":{"node":"0.8.x"},"preferGlobal":true,"_id":"oppo@0.1.1","dist":{"shasum":"46ac469dd92dbdb7e3ab28dcb9b3dbbea179125b","tarball":"https://registry.npmjs.org/oppo/-/oppo-0.1.1.tgz","integrity":"sha512-gc5GOyUpj8S24jlYnFZGztaNJzECPsoVgZkpBVynVX/362l9S2eBg4IMVpL/aTKNkqSHjmD3rRaynW92xpZDsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0MgBU4PqZSpYIKoJILnvy35+zJVFzSqISj6SEpwKowAiEA94jzaavmBbiSV8733YSx7C0uHF1gx5nYmmWEaeLdxWM="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"benekastah","email":"benekastah@gmail.com"},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"deprecated":"This package doesn't really work and was just an educational exercise. It shouldn't really be on npm, but since it seems to be getting downloaded I'll leave it up. Bottom line, if you want this to work for you, you should probably just fork the project."},"0.1.2":{"name":"oppo","description":"A lisp for javascript","keywords":["lisp","functional programming","fp","parser","compiler"],"version":"0.1.2","main":"dist/oppo.js","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"bin":{"oppo":"./bin/oppo"},"scripts":{"postinstall":"bin/build"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"dependencies":{"optimist":"0.2.x","uglify-js":"*","uglify-js2":"*"},"optionalDependencies":{"uglify-js":"*","uglify-js2":"*"},"devDependencies":{"coffee-script":"1.x.x"},"engines":{"node":"0.8.x"},"preferGlobal":true,"_id":"oppo@0.1.2","dist":{"shasum":"77818692b3b7d90f1917bcceddba9932e24f13de","tarball":"https://registry.npmjs.org/oppo/-/oppo-0.1.2.tgz","integrity":"sha512-AGaIxsoZwBsa0xGRVlsIsCjna+vuoisuO01LpKa7J8mH6gORa3T+ymCkmRKVc17hCeBVpM8UJxiv7LYUENr4Yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxaTwB/bmK4/Gr/PKzJMCbKZuRJqpZObariMa3epiC2QIgbQGODoHQdqXfEEHrUabWWHEuNvYLn5Y1i79THM99ZVo="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"benekastah","email":"benekastah@gmail.com"},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"deprecated":"This package doesn't really work and was just an educational exercise. It shouldn't really be on npm, but since it seems to be getting downloaded I'll leave it up. Bottom line, if you want this to work for you, you should probably just fork the project."},"0.1.3":{"name":"oppo","description":"A lisp for javascript","keywords":["lisp","functional programming","fp","parser","compiler"],"version":"0.1.3","main":"dist/oppo.js","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"bin":{"oppo":"./bin/oppo"},"scripts":{"postinstall":"bin/build"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"dependencies":{"optimist":"0.2.x","uglify-js":"*","uglify-js2":"*"},"optionalDependencies":{"uglify-js":"*","uglify-js2":"*"},"devDependencies":{"coffee-script":"1.x.x"},"engines":{"node":"0.8.x"},"preferGlobal":true,"_id":"oppo@0.1.3","dist":{"shasum":"a7c4246482dfc2c24e65967b98e7d345a2d743f7","tarball":"https://registry.npmjs.org/oppo/-/oppo-0.1.3.tgz","integrity":"sha512-IQEEzP0PHUxEGRzIjCpaITj5oUCuRmx8Gkaaf0/KPjy+eBAdJn4u9s6ymhIlPzh9M1gB9HUfFbUccBtGcCswUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXfcN38vfOQTcHjF7UEyTAs0DAyHbXIH0bnKa81pl6BAiEA7EB14H64viggUjZwQh85ab9E6fnsXGbEFASm+D9x/ck="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"benekastah","email":"benekastah@gmail.com"},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"deprecated":"This package doesn't really work and was just an educational exercise. It shouldn't really be on npm, but since it seems to be getting downloaded I'll leave it up. Bottom line, if you want this to work for you, you should probably just fork the project."}},"maintainers":[{"name":"benekastah","email":"benekastah@gmail.com"}],"time":{"modified":"2022-06-23T00:58:27.052Z","created":"2011-11-27T03:32:54.664Z","0.0.1":"2011-11-27T03:49:45.737Z","0.1.0":"2012-10-19T02:15:56.881Z","0.1.1":"2012-10-19T02:21:23.608Z","0.1.2":"2012-10-19T02:26:16.761Z","0.1.3":"2012-10-19T21:25:23.267Z"},"description":"A lisp for javascript","author":{"name":"Paul Harper","email":"benekastah@gmail.com"},"repository":{"type":"git","url":"git@github.com:benekastah/oppo.git"},"keywords":["lisp","functional programming","fp","parser","compiler"],"readme":"# Oppo\n\n**Oppo is a sweet little lisp for javascript.** This is experimental,\n  and therefore any suggestions are welcome.\n  \n## Usage\n\nTo install, run the following in your terminal. Make sure you have\nnode.js and npm installed first.\n\n```\nnpm install -g oppo\n```\n\nNow you have access to the `oppo` command. To enter the repl:\n\n```\noppo\n```\n\nor\n\n```\noppo -r\n```\n\nTo compile a file:\n\n```\noppo -c /path/to/file.oppo\n```\n\nYou can also specify an output file:\n\n```\noppo -o /path/to/file.js -c /path/to/file.oppo\n```\n\nIn the previous command, if you have `uglify-js2` installed globally,\nit will prettify the resulting javascript. You could pass the `-C` switch to\nhave it compress your code instead.\n\nTo run a file:\n\n```\noppo /path/to/file.oppo\n```\n  \n## Language Overview\n\n### The basics\n\nSince oppo is a lisp, it takes on the basic semantics of a lisp. Oppo\nisn't dissimilar to scheme or clojure, so if you want to get a feel\nfor the basic semantics of lisp, there's plenty of code out there to\nlook at.\n\nHere are some specifics about the way oppo is parsed:\n\n#### Numbers\n  - Integer: `2`\n  - Float: `2.5`, `.34`\n  - Scientific notation: `10e-2.5`\n  - Explicit base: `2#1101`, `8#1427`, `16#-fff`\n  \n#### Strings\n`\"whatever\"`. If you need to escape a double-quote, you can use `\\\"`.\n\n#### Symbols\nOppo accepts most characters as valid symbols. Symbols can't start\nwith a number or any of the following sequences: `#`, `\"`, `'`, `\\``,\n`,`, `,@`, `.`. Symbols can't contain any kind of whitespace. Anything\nelse on the US keyboard is fair game.\n\n#### Lists\nLists are code. Oppo code is primarily a tree of lists. All lists are\nexecutable. The basic way to make a list is to put space-separated\nitems in parenthesis:\n\n```\n(puts \"I\" \"am\" \"a\" \"list\")\n```\n\nSince lists are executable, this will call the `puts` macro, which\nwill log the rest of the items in the list to the console. If you\ndon't want your list to be executed you can quote it or use a literal\narray:\n\n```\n'(1 2 3) ;; Won't try to call this as a function\n#[1 2 3] ;; Same result\n```\n\n#### Objects\nOppo only thinks of objects as data and never tries to execute an\nobject. Objects are made like this:\n\n```\n#{'a 1 'b 2}\n```\n\nYou can do some interesting things with oppo objects that you can't do\nin javascript (at least not as easily). For example, keys can be\nvariables in the same way their values can:\n\n```\n(def key 'asdf)\n(def value 5)\n#{key value} ;; -> #{asdf 5}\n```\n\n#### Functions\nOppo uses the `lambda` macro to generate functions. There is also a\nreader macro `#(...)` which acts as a shorthand for the lambda\nmacro. You can also define a function with the `def` macro:\n\n```\n(lambda (a b) (+ a b))\n\n#(+ #1 #2) ;; #1 and #2 access the 0th and 1st arguments respectively\n\n(def (add-a-b a b)\n  (+ a b))\n```\n\nFollowing is a list of macros, functions and variables available to\nthe oppo programmer. Entries take the format of\n`<module>::<item-name>`. The `core` module is automatically available,\nso you don't have to use the module prefix in that case. As an\nexample, you can call `core::str` by simply invoking `str` (unless you\nhave  replaced `str` in your current module or in an active local\nscope).\n\n### core module\n  - macro `core::defmacro`: `(defmacro optional-metadata (macro-name\n    ...args) ...body)`\n    Defines a macro.\n    \n    Example:\n    ```\n    (defmacro (log ...x)\n      `(.log console ,@x))\n    ```\n    \n  - macro `core::def`: `(def optional-metadata name value)` | `(def\n    optional-metadata (fn-name ...args) ...body)`\n    Defines a variable on the current module.\n    \n    Example:\n    ```\n    ;; Define module variable\n    (def one 1)\n    ;; Define function\n    (def (identity x) x)\n    ```\n    \n  - macro `core::set!`: `(set! name value)`\n    Resets the value of a variable.\n    \n    Example:\n    ```\n    (def n 1)\n    (set! n (+ n 1))\n    ```\n    \n  - macro `core::lambda`: `(lambda (...args) ...body)`\n    Creates a function. You can also use the `#(...)` reader macro for\n    this. Arguments that aren't named can still be accessed from the\n    `arguments` object. A reader macro is provided for this as well,\n    `#1` where the `1` can be any number greater than 0. `#1` will\n    access the 0th argument, `#2` the first argument and so on.\n    \n    Example:\n    ```\n    (map (lambda (a)\n           (+ a 1)) #[1 2 3 4 5]) ;; -> #[2 3 4 5 6]\n           \n    (map #(+ #1 1) #[1 2 3 4 5]) ;; -> #[2 3 4 5 6]\n    ```\n    \n  - macro `core::call`: `(call callable-item ...args)`\n    This is used internally for all function/macro calling. This is\n    not generally the way you will need to call things.\n    \n    Example:\n    ```\n    (call puts 1 2 3)\n    ;; The normal way to call things is without `call`.\n    ;; Running it this way will do the same thing as the line above.\n    (puts 1 2 3)\n    ```\n    \n  - macro `core::object-get-value`: `(object-get-value prop base)`\n    Gets the value with the corresponding `prop` in a collection. You\n    shouldn't often need to invoke this directly. See example below.\n    \n    Example:\n    ```\n    (object-get-value 'alert window)\n    \n    ;; Here's a better way to do this:\n    ('alert window)\n    ;; or\n    (\"alert\" window)\n    ```\n    \n  - macro `core::.`: `(. fname base ...args)`\n    Gets a callable value from `base` and immediately calls it with\n    `args`. Because of a handy reader macro, there doesn't need to be\n    a space separating the `.` from the `fname`.\n    \n    Example:\n    ```\n    (.alert window 5)\n    (.\"static\" express)\n    ```\n    \n  - macro `core::quote`: `(quote x)`\n    Quotes `x`. Instead of using the explicit call, most of the time\n    you will want to use the reader macro `'`.\n    \n    Example:\n    ```\n    (quote x) ;; -> x\n    'x ;; -> x\n    ```\n    \n  - macro `core::quasiquote`: `(quasiquote x)`\n    Quasiquotes `x`. You can also use the reader macro `\\``.\n    \n    Example:\n    ```\n    (def a 5)\n    `(1 2 3 4 a ,a) ;; -> '(1 2 3 4 a 5)\n    ```\n    \n  - macro `core::unquote`: `(unquote x)`\n    Unquotes `x`. You can also use the reader macro `,`.\n    \n    Example:\n    ```\n    (def a 5)\n    `(1 2 3 4 a ,a) ;; -> '(1 2 3 4 a 5)\n    ```\n    \n  - macro `core::unquote-splicing`: `(unquote-splicing x)`\n    Unquotes each item in `x` in sequence into another structure. You\n    can also use the reader macro `,@`.\n    \n    Example:\n    ```\n    (def a #[1 2 3 4 5])\n    `(0 ,@a 6) ;; -> #[0 1 2 3 4 5 6]\n    ```\n    \n  - macro `core::let`: `(let (...bindings) ...body)`\n    Introduces a local scope. `bindings` are the local variables. It\n    will run each item in body in this new local scope and return the\n    result of the last item.\n    \n    Example:\n    ```\n    (let [a 1\n          b 2\n          c 3]\n       (+ a b c)) ;; -> 6\n    ```\n    \n  - macro `core::if`: `(if condition run-if-true optional-run-if-false)`\n    `if` expression.\n    \n    Example:\n    ```\n    (if (nil? x)\n      (do-something)\n      (do-something-else))\n    ```\n    \n  - macro `core::for`: `(for [defs ls] ...body)`\n    The `for` expression is very similar to map, but can be much\n    faster.\n    \n    Example:\n    ```\n    ;; `n` represents an item in the array.\n    (for [n #[1 2 3 4 5]] (* n 2)) ;; -> #[2 4 6 8 10]\n    ;; `n` represents an item in the array and `i` represents the index.\n    (for [(n i) #[1 2 3 4 5]] (+ n i)) ;; -> #[1 3 5 7 9]\n    ```\n    \n  - macro `core::do`: `(do ...body)`\n    `do` will run each item in `body` and give you the result of the\n    last statement.\n    \n    Example:\n    ```\n    (if (< n 5)\n      (do\n        (puts n)\n        (set! n (+ n 1))))\n    ```\n    \n  - macro `core::include`: `(include ...module-names)`\n    This will find and compile each module. If the module has already\n    been compiled, then it is already available and will not attempt\n    to compile it again.\n    \n    Modules are simple directory paths that are resolved in the same\n    base directory as the main file. Generally, you should only send\n    one single file to the oppo compiler, and this file will include\n    all the modules it needs, and those modules will include the modules\n    they need, and so forth. In this way, the compiler will get all\n    the source files used and compile them all into a single\n    javascript file.\n    \n    Example:\n    ```\n    (include routes/main routes/users)\n    \n    (.get app \"/\" routes/main::home)\n    (.get app \"/user/:id\" routes/users::show)\n    ```\n    \n  - macro `core::apply`: `(apply fn args)`\n    This is the same as using the javascript .apply function, except\n    you can't specify scope.\n  \n  - macro `core::require`: `(require module-name)` | `(require varname\n    module)`\n    Makes using the node.js require function (or any implementation\n    similar enough) simpler to use.\n    \n    Example:\n    ```\n    (require express) ;; var express = require('express');\n    (require routes \"./routes\") ;; var routes = require('./routes');\n    ```\n    \n  - macro `core::new`: `(new Class ...args)`\n    Allows you to instantiate a class.\n    \n  - macro `core::puts`: `(puts ...args)`\n    Logs output to the console.\n    \n  - macro `core::puts-warning`: `(puts-warning ...args)`\n    Logs warning message to the console.\n    \n  - macro `core::puts-error`: `(puts-error ..args)`\n    Logs error message to the console.\n    \n  - macro `core::cond`: `(cond cond1 body1 cond2 body2 cond-n body-n)`\n    Evaluates each condition until it finds one that is true. When it\n    finds a true condition, it executes the corresponding body.\n    \n    Example:\n    ```\n    (def n 3)\n    (cond\n      (eq n 1) (puts \"one\")\n      (eq n 2) (puts \"two\")\n      (eq n 3) (puts \"three\")\n      'else (puts \"idk\")) ;; will print \"three\" to the console.\n    ```\n    \n  - macro `core::use-from`: `(use-from module ...items)`\n    Extracts items from `module` and defines a copy locally.\n    \n    Example:\n    ```\n    (use-from js eval\n                 typeof) ;; Now the macros eval and typeof are\n    available in the current scope.\n    ```\n    \n  - macro `core::use`: `(use module1 defs1 module2 defs2 module-n defs-n)`\n    With each module and defs pair, it calls `use-from`.\n    \n    Example:\n    ```\n    (use module-a [a b c]\n         module-b [d e f])\n    ```\n    \n  - macro/function `core::symbol`: `(make-symbol x)`\n    Generates a symbol from x.\n    \n    Example:\n    ```\n    (symbol 'asdf)\n    (symbol \"asdf\")\n    ```\n    \n  - **Basic operations**\n    These are all of type macro/function, and are all in the module\n    `core`. They all correspond with the same operator in javascript\n    unless otherwise noted.\n    \n    **Math**\n      - `+`\n      - `-`\n      - `*`\n      - `/`\n    \n    **Logical**\n      - `not` (javascript `!`)\n      - `or` (javascript `||`)\n      - `and` (javascript `&&`)\n      \n    **Comparison**\n      - `<`\n      - `>`\n      - `<=`\n      - `>=`\n      - `eq` (javascript `===`)\n      - `not-eq` (javascript `!==`)\n      - `eq~` (javascript `==`)\n      - `not-eq~` (javascript `!=`)\n  \n  - **Type checking**\n    All the following are of type function/macro and check to see that their\n    argument is equal to the type the name describes. (For example,\n    `(number? x)` returns true when `x` is a number). All are in the\n    `core` module.\n    \n      - `number?`\n      - `string?`\n      - `array?`\n      - `arguments?` (returns true when its argument is a function's\n        arguments object.)\n      - `nil?` (returns true when its argument is either null or\n        undefined.)\n      - `function?`\n      - `regex?`\n      - `date?`\n  \n  - function `core::typeof`: `(typeof x)`\n    This is the `toType` function by Angus Croll found\n    [here](https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/).\n    \n  - function `core::eval`: `(eval to-eval)`\n    This invokes oppo's compiler on `to-eval`, `eval`s the compiled\n    code using the javascript `eval` function and returns the computed\n    result.\n    \n    Example:\n    ```\n    (eval '(+ 1 1)) ;; -> 2\n    ```\n    \n  - function `core::empty?`: `(empty? coll)`\n    Checks to see if a collection is empty. Accepts argument of any\n    type. Empty arrays, objects and strings will return\n    true. Additionally, `#nil` and `0` will also return true. Anything\n    else will return false.\n    \n  - function `core::contains?`: `(contains? coll value\n    optional-deep-eq)`\n    Checks to see if the collection contains the\n    value. `optional-deep-eq` is `#true` by default. If it is set to\n    `#false`, it will use the `===` operator for comparison rather\n    than the oppo `=` function.\n    \n  - function `core::contains-key?`: `(contains-key? coll, key)`\n    Checks to see if the collection contains the given key. Works for\n    arrays, the arguments object, strings and objects. If you pass\n    something else for `coll`, the result will be `#false`.\n    \n  - function `core::list`: `(list ...args)`\n    Makes a list out of the arguments. You can call this function\n    directly, or you can use the `#[...]` reader macro.\n    \n    Example:\n    ```\n    (= (list 1 2 3) #[1 2 3]) ;; -> #true\n    ```\n    \n  - function `core::->list`: `(->list object)`\n    Turns any object with a length property into a list.\n    \n  - function `core::map`: `(map fn list)`\n    Invokes `fn` with each item in `list` and gathers the results of\n    those calls into an array, which is returned. Similar to `for`.\n    \n    Example:\n    ```\n    (def ls #[1 2 3 4 5])\n    (map #(* #1 2) ls) ;; -> #[2 4 6 8 10]\n    ```\n    \n  - function `core::reduce`: `(reduce fn list)`\n    Invokes `fn` with the first two items in `list`, gets the result,\n    and then continues through the rest of the list calling `fn` with\n    the previous result and the next item in the list until the list\n    is exhausted. Returns the final result.\n    \n    Example:\n    ```\n    (def ls #[1 2 3 4 5])\n    (reduce * ls) ;; -> 120\n    ```\n    \n  - function `core::reduce-right`: `(reduce-right fn list)`\n    Same as `core::reduce`, but operates on the list in reverse.\n    \n  - function `core::filter`: `(filter fn list)`\n    Invokes `fn` on each item in the list and returns a new list of\n    all the items for which `fn` returned a truthy value.\n    \n    Example:\n    ```\n    (def (is-odd? n)\n      (> (mod n 2) 0))\n      \n    (def ls #[0 1 2 3 4 5 6])\n    (filter is-odd? ls) ;; -> #[1 3 5]\n    ```\n    \n  - function `core::concat`: `(concat ls1 ls2 ls-n)`\n    This works on lists and strings, but if you are working on lists\n    then each `ls` must be a list and if you are working on strings\n    then each `ls` must be a string. It uses the native `concat`\n    method for lists and strings respectively.\n    \n  - function `core::first`: `(first ls)`\n    Returns the first item in an ordered collection.\n    \n  - function `core::second`: `(second ls)`\n    Returns the second item in an ordered collection.\n    \n  - function `core::third`: `(third ls)`\n    Returns the third item in an ordered collection.\n    \n  - function `core::last`: `(last ls)`\n    Returns the last item in an ordered collection.\n    \n  - function `core::slice`: `(slice ls start optional-end)`\n    Returns a list of all the items between `start` and either\n    `optional-end` or the end of the list.\n    \n  - function `core::head`: `(head ls)`\n    Returns a new list of all the items in `ls` except the last one.\n    \n  - function `core::tail`: `(tail ls)`\n    Returns a new list of all the items in `ls` except the first one.\n    \n  - function `core::nth`: `(nth ls n)`\n    Returns the `n`th item of `ls`. Operates on `ls` as if it were\n    1-indexed.\n    \n    Example:\n    ```\n    (def ls #[1 2 3])\n    (nth ls 1) ;; -> 1\n    ```\n    \n  - function `core::object`: `(object key1 value1 key2 value2 key-n\n    value-n)`\n    Creates an object. You can also use the reader macro `#{...}`\n    \n    Example:\n    ```\n    (object 'a 1 'b 2 'c 3 'd 4 'e 5) ;; -> #{a 1\n                                              b 2\n                                              c 3\n                                              d 4\n                                              e 5}\n    ```\n    \n  - function `core::->object`: `(->object x)`\n    Converts `x` into an Object.\n    \n  - function `core::merge`: `(merge ...objects)`\n    Creates a new object with the combined properties of each object\n    passed in. If there are conflicts, objects passed in later will\n    have priority.\n    \n    Example:\n    ```\n    (def o1 #{'a 1 'b 2 'c 3})\n    (def o2 #{'a #nil 'd 4})\n    (merge o1 o2) ;; -> #{a #nil\n                          b 2\n                          c 3\n                          d 4}\n    ```\n    \n  - function `core::keys`: `(keys obj)`\n    Returns all direct keys of any object. This will not return keys\n    on the prototype of the object.\n    \n  - function `core::str`: `(str ...strings)`\n    Concatenates all `strings` into a single string. Arguments do not\n    have to explicitly be a string. If they are not a string, they\n    will be converted into a string for the final result.\n    \n  - function `core::->string`: `(->string x)`\n    Converts `x` into a string.\n    \n  - function `core::->number`: `(->number x)`\n    Converts `x` into a number.\n    \n  - function `core::->boolean`: `(->boolean x)`\n    Converts `x` into a boolean.\n    \n  - function `core::=`: `(= ...items)`\n    Checks to see if all items are equal to each other. In the case of\n    objects, `=` will check to see if the objects are similar enough\n    to be considered equal.\n    \n  - function `core::not=`: `(not= ...items)`\n    The inverse of `core::=`.\n    \n  - function `core::list?`: `(list? x)`\n    Checks if x is a list (it is either an array or an arguments\n    object).\n    \n  - function `core::object?`: `(object? x)`\n    Checks if x is any kind of object.\n    \n  - function `core::isNaN?`: `(isNaN? x)`\n    Checks if x is the `isNaN` primitive.\n    \n  - object `core::global`\n    This refers to `global` when it is available and `window` otherwise.\n    \n### js module\n  - macro `js::eval`: `(js::eval to-eval)`\n    If you pass in a string, `js::eval` will dump that string as-is\n    into the compiler output. If you pass in anything else, it will be\n    compiled normally and then passed to the javascript `eval`\n    function.\n    \n    Example:\n    ```\n    (def obj #{'a 1 'b 2})\n    (if (js::eval \"'a' in obj\")\n      (do-something obj))\n    ```\n    \n  - macro `js::typeof`: `(js::typeof x)`\n    This is the same as the javascript operator `typeof`.\n    \n    Example:\n    ```\n    (typeof 5) ;; -> \"number\"\"\n    (typeof #nil) ;; -> \"object\"\n    ```\n","readmeFilename":"","users":{"janharvey":true}}