Fix sorting in asm.c. Add README text.

This commit is contained in:
Calvin Rose 2019-01-09 17:09:16 -05:00
parent 16ebb11181
commit 62cb3f81fe
3 changed files with 12 additions and 3 deletions

View File

@ -74,7 +74,8 @@ environment, use the `(all-symbols)` function.
Install a stable version of janet from the [releases page](https://github.com/janet-lang/janet/releases).
Janet is prebuilt for a few systems, but if you want to develop janet, run janet on a non-x86 system, or
get the latest, you must build janet from source.
get the latest, you must build janet from source. Janet is in alpha and may change
in backwards incompatible ways.
## Usage

View File

@ -79,9 +79,9 @@ static const JanetInstructionDef janet_ops[] = {
{"get", JOP_GET},
{"geti", JOP_GET_INDEX},
{"gt", JOP_GREATER_THAN},
{"gten", JOP_NUMERIC_GREATER_THAN_EQUAL},
{"gtim", JOP_GREATER_THAN_IMMEDIATE},
{"gtn", JOP_NUMERIC_GREATER_THAN},
{"gten", JOP_NUMERIC_GREATER_THAN_EQUAL},
{"jmp", JOP_JUMP},
{"jmpif", JOP_JUMP_IF},
{"jmpno", JOP_JUMP_IF_NOT},

View File

@ -1671,6 +1671,13 @@ value, one key will be ignored."
(status-pp sig x f source))))
(run-context newenv chunks onsignal "repl"))
(defmacro meta
"Add metadata to the current environment."
[& args]
(def opts (table ;args))
(loop [[k v] :pairs opts]
(put *env* k v)))
(defn all-bindings
"Get all symbols available in the current environment."
[env &]
@ -1679,6 +1686,7 @@ value, one key will be ignored."
(do (var e env) (while e (array/push envs e) (set e (table/getproto e))))
(def symbol-set @{})
(loop [envi :in envs
k :keys envi]
k :keys envi
:when (symbol? k)]
(put symbol-set k true))
(sort (keys symbol-set)))