{"id":16880561,"url":"https://github.com/squaremo/dolt","last_synced_at":"2025-04-11T11:44:19.528Z","repository":{"id":4901890,"uuid":"6057926","full_name":"squaremo/dolt","owner":"squaremo","description":"Super REPL","archived":false,"fork":false,"pushed_at":"2013-03-04T15:04:49.000Z","size":637,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T21:56:39.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"codeforeurope/TagCheckScore","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squaremo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-03T09:31:48.000Z","updated_at":"2024-02-05T21:15:20.000Z","dependencies_parsed_at":"2022-09-16T07:40:18.932Z","dependency_job_id":null,"html_url":"https://github.com/squaremo/dolt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fdolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fdolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fdolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaremo%2Fdolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squaremo","download_url":"https://codeload.github.com/squaremo/dolt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248387061,"owners_count":21095148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:59:15.679Z","updated_at":"2025-04-11T11:44:19.507Z","avatar_url":"https://github.com/squaremo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fun with REPLs\n\n    npm install \u0026\u0026 npm start\n    open http://localhost:8000/\n\n\u003c!-- The name comes from\nhttp://www.folklore.org/StoryView.py?project=Macintosh\u0026story=Do_It.txt\n--\u003e\n\n## Language\n\nThe language available in the REPL has a syntax largely taken from\nJavaScript, with slightly different semantics. The JavaScript-like\nessentials are:\n\n    // values\n    1, 'foo', true // number, string, boolean literals\n    {foo: 1}       // object literal\n    [1,2,3]        // array literal\n    \n    // arithmetic\n    1 + 2 - 3 / 4 * 5   // operators\n    n += 1  // in-place arithmetic\n    n \u003c 3   // comparison\n\n    // other stuff you might expect\n    var x = 1      // assignment\n    foo.bar       // field access\n    frob(1, 'foo')        // procedure call\n    \nThere are no prototypes and no dynamically-scoped `this` variable;\nhowever, fields may be procedures, and some of the built-ins look\nlike methods.\n\n### Sequences and comprehensions\n\nSequences are an addition; in general these are produced by built-ins\n(e.g., `range` just below) and comprehensions, and are\nlazy[[1]](#footnote1). Arrays will be lifted to sequences when treated\nas a sequence; sequences may be indexed, in which case they are\nevaluated up to the element given.\n\nThe built-in `range` produces a sequence starting at its first\nargument and ending less than or equal to its second argument, incrementing\nby its third argument (or `1` if not supplied).\n\n    range(0, 10, 2) // =\u003e 0,2,4,6,8,10 in a sequence\n    range(0, 10, 3) // =\u003e 0,3,6,9\n    range(0, 10)[2] // =\u003e 2\n\n\u003c!-- %% No unary ops yet\nThe step may be negative, in which case it ends greater than or equal\nto:\n\n    range(10, 0, -3) // =\u003e 10,7,4,1\n--\u003e\n\nSequences support `map`, `where`, and `concat` operations, all\nreturning lazy sequences. The first two take, in argument position,\nan expression to be applied to each element:\n\n    [1,2,3].map(_ + 1)\n    range(0, 10).where(_ \u003c 5)\n\nThe variable `_` is bound to the element being considered. If the\nelement is an object, its field names will also be bound when the\nexpression is evaluated:\n\n    [{foo: 1}, {foo: 2}].map(foo + 1)\n\nThe name to be bound may also be supplied, in which case field access must\nbe explicit:\n\n    [{foo: 1}, {foo: 2}].map(x, x.foo + 1)\n\nThe result is always a sequence, so `map` and `where` may be chained together:\n\n    range(0, 10).map(_ + 1).where(_ \u003c 5)\n\nComprehensions represent sequences by specifying a generating\nexpression, a map expression, and optionally a where expression:\n\n    [_ + 1 for [1,2,3]]\n    [x + 1 for x in [1,2,3]]\n    [x + 1 for x in range(0, 10) if x \u003c 5]\n\nThese may be nested, in which case the inner generation expression and\nwhere expression have both the outer and inner elements bound:\n\n    [x + y for x in range(0, 10); y in range(0, x) if x * y \u003c 10]\n\n### String interpolation\n\nStrings with double quotes are treated as patterns to be\ninterpolated. Expressions within curly braces in such a string are\nevaluated in the local environment:\n\n    \"The answer is {2 + 2}\" // =\u003e 'The answer is 4'\n\nThese can be used in maps and comprehensions, of course:\n\n      [\"Foo = {foo}\" for [{foo: 1}, {foo: 2}]]\n\n### Object construction\n\nThere is shorthand for constructing objects in which the field names\nmatch variable names; this is especially useful in maps and\ncomprehensions:\n\n    var foo = 1; {foo} // =\u003e {foo: 1}\n    [{bar} for [{foo: 1, bar: 2}, {foo: 2, bar: 3}]]\n\n------\n\n\u003ca name=\"footnote1\"\u003e[1]\u003c/a\u003e They are \"even streams\" as described\n(albeit in the context of Scheme) at\n\u003chttp://srfi.schemers.org/srfi-41/srfi-41.html\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaremo%2Fdolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquaremo%2Fdolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaremo%2Fdolt/lists"}