{"action":"created","issue":{"url":"https://api.github.com/repos/jscl-project/jscl/issues/247","repository_url":"https://api.github.com/repos/jscl-project/jscl","labels_url":"https://api.github.com/repos/jscl-project/jscl/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/jscl-project/jscl/issues/247/comments","events_url":"https://api.github.com/repos/jscl-project/jscl/issues/247/events","html_url":"https://github.com/jscl-project/jscl/pull/247","id":170901882,"number":247,"title":"Support for radix, Unicode","user":{"login":"brpocock","id":2066235,"avatar_url":"https://avatars.githubusercontent.com/u/2066235?v=3","gravatar_id":"","url":"https://api.github.com/users/brpocock","html_url":"https://github.com/brpocock","followers_url":"https://api.github.com/users/brpocock/followers","following_url":"https://api.github.com/users/brpocock/following{/other_user}","gists_url":"https://api.github.com/users/brpocock/gists{/gist_id}","starred_url":"https://api.github.com/users/brpocock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brpocock/subscriptions","organizations_url":"https://api.github.com/users/brpocock/orgs","repos_url":"https://api.github.com/users/brpocock/repos","events_url":"https://api.github.com/users/brpocock/events{/privacy}","received_events_url":"https://api.github.com/users/brpocock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-12T15:50:08Z","updated_at":"2016-11-01T17:32:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jscl-project/jscl/pulls/247","html_url":"https://github.com/jscl-project/jscl/pull/247","diff_url":"https://github.com/jscl-project/jscl/pull/247.diff","patch_url":"https://github.com/jscl-project/jscl/pull/247.patch"},"body":"This is a merge of the Radix & Unicode support from `radishes` branch, designed to be more amenable to merging with `master`. The tests are bundled separately.\n\nBundled  set  of changes  to  support  reading  and printing  things  in arbitrary numeric radix 2-36 and more.\n- Fix edge case in `read-whole-file` triggered by UTF-8 (bytes vs. chars) leaving #\\null bytes after prelude\n- Checks output of `!compile-file` for presence of control characters like #\\null (built-in regression-type check)\n- Defines a somewhat-useful `assert`.\n- Moves some character-related code from boot.lisp and char.lisp into new file early-char.lisp, removing duplication between them.\n- Provides a usable approximation of `equalp`\n- Binds (and, in many cases, actually uses the value of):\n  -  `*print-escape*`\n  -   `*print-readably*`\n  -  `*print-circle*`\n  - `*print-radix*`\n  - `*print-base*`\n  - `*read-base*`\n- Makes a change to `graphic-char-p` to filter out both control codes as well as high & low surrogates and invalid code-points\n- `char-name` returns `U+`_xxxx_ for characters without a name — ie, char-code ≥ #x100\n- `name-char` accepts `U+`_xxxx_ notation (also `u+`)\n- `js-escape-string` properly handles escaping control characters C0 and C1, as\n  - #\\return → \\r\n  - #\\tab → \\t\n  - #\\page → \\f\n  - #\\backspace → \\b\n  - #\\null → \\0\n  - code-char 1…26 → \\cA … \\cZ\n  - code-char 27…31 → \\x1B … \\x1F\n  - code-char 127…159 → \\u00XX\n- Some uses of `#\\'` literals changed in source to `#\\apostrophe` because (at least my Gnu) Emacs misread them and threw off indentation/highlighting. Sadly this is an Emacs bug, not a problem with the JSCL sources.\n- Implemented `logior` (needed in this branch) and `logand`, `logxor` (for completeness)\n- `safe-js-name` used to convert Lisp symbols into similar-looking Javascript symbols. This, in turn, is used by `gvarname` and `genlit` and some other places to produce more æsthetic “object code.” These names are (much) more verbose, like `v123` → `var_ELEMENT_COUNT_123`. I assume two things: More similar names will make debugging easier; and if you care how long the file is, you will run CL-UGLIFY or some Javascript minifier over the output, which will rename everything for you.\n- Many places in the JS will `throw new Error(…)` rather than `throw \"string\"` to enable backtraces.\n- Some JS errors are more verbose, to aid debugging.\n- `digit-char-p` handles digits in base 2-36, and accepts any Unicode decimal digit _or_ ASCII _or_ fullwidth Latin letters.\n- `digit-char` works for base 2-36\n- Prelude ƒ `char_to_codepoint` does not break on malformed strings passed in, but may signal an error; also `safe_char_upcase`. (Errors in the Unicode reading could throw garbage strings at these functions, which were otherwise quite hard to debug.)\n- `*standard-output*` will echo to `console.error` earlier in the startup process so bootstrapping assertion failures can be reported.\n- `potential-number-p` honors `*read-base*`\n- `write-integer` honors `*print-base*`\n- writing character literals uses `#\\Space` (arguably what CLHS prefers, but SBCL likes `#\\` instead), or all other C0/C1 controls appear as `#\\` . #'char-name \n- `princ` handles printing (aesthetically) characters and symbols (particularly keywords) correctly.\n- `format`:\n  - decimal, quoted-char, or `v` arguments, `:` or `@` modifiers captured.\n  - ~a and ~_mincol_a with space-padding (only); ~a works more correctly due to `princ` fixes.\n  - ~b, ~o, ~x printing\n  - ~_n_r for 2 ≤ _n_ ≤ 36.\n  - ~_mincol_d, ~_mincol_x with space-padding.\n  - ~@b, ~@d, ~@o, ~@x\n  - ~:b, ~:d, ~:o, ~:x recognized but not working 100%\n  - ~:r, ~@:r, ~@r print “placeholders” like `#<Roman numeral 25>`\n  - ~% (as before)\n  - ~& prints #\\newline; ~1& prints #\\newline; ~_n_& 2 ≤ _n_ prints (1- _n_) newlines.\n  - ~w should work, to the limits of `write`\n  - ~c, ~:c, ~@c\n  - ~e, ~f, ~g, ~$ are recognized but treated as ~s\n  - ~( ~{ ~[ ~< ~> ~] ~} ~) issue warnings.\n  - ~t, ~_n_t prints (1 resp. _n_) spaces\n  - ~p, ~@p, ~:p, ~:@p\n  - ~~ (as before)\n  - ~:#\\newline (but ~#\\newline acts like ~:#\\newline also)\n  - ~| (but not: ~_n_|)\n  - ~\\* (as before), but also ~:\\* (but not: ~@*)\n- Minimal `with-input-from-string`\n- `%peek-char` supports look-ahead\n- Reader accepts:\n  - `#\\u+`_x_ or `#\\` + (any `name-char`)\n  - #\\b #\\o #\\x literals\n  - #*n*r literals are parsed\n  - #*n*( arrays are spotted, but signal an error if encountered.\n  - `*read-base*` is honored\n- `parse-integer` accepts `:start :end :radix`\n- `ls-read` → `read`\n- `substitute-if`[`-not`] implemented\n- `substitute` accepts `:start :end :count`, recognizes (but ignores with warning) `:test-not :from-end`\n- `every` handles walking `more-seqs` in parallel, eg `(every #'= '(1 2 3) '(1 2 3))`\n- `concatenate` for `'string` or `'list`\n- `integer-to-string` honors `*print-base*` or accepts a radix. Also takes an optional `plusp` to print `~@d` &c.\n\nThe related test cases are in the parallel PR.\n"},"comment":{"url":"https://api.github.com/repos/jscl-project/jscl/issues/comments/257633707","html_url":"https://github.com/jscl-project/jscl/pull/247#issuecomment-257633707","issue_url":"https://api.github.com/repos/jscl-project/jscl/issues/247","id":257633707,"user":{"login":"brpocock","id":2066235,"avatar_url":"https://avatars.githubusercontent.com/u/2066235?v=3","gravatar_id":"","url":"https://api.github.com/users/brpocock","html_url":"https://github.com/brpocock","followers_url":"https://api.github.com/users/brpocock/followers","following_url":"https://api.github.com/users/brpocock/following{/other_user}","gists_url":"https://api.github.com/users/brpocock/gists{/gist_id}","starred_url":"https://api.github.com/users/brpocock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brpocock/subscriptions","organizations_url":"https://api.github.com/users/brpocock/orgs","repos_url":"https://api.github.com/users/brpocock/repos","events_url":"https://api.github.com/users/brpocock/events{/privacy}","received_events_url":"https://api.github.com/users/brpocock/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T17:32:53Z","updated_at":"2016-11-01T17:32:53Z","body":"Rebased on current `master` and brought in the tests, which had previously (perhaps very foolishly) been in a separate PR."}}
{"actor":{"display_login":"brpocock"}}