1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-13 01:43:50 +03:00

Merge pull request #312 from jonaslu/add_metadata_reader_macro_in_docs

Update guide with note on reader macro with-meta
This commit is contained in:
Joel Martin 2018-01-02 09:51:23 -06:00 committed by GitHub
commit c0f10162f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1527,6 +1527,11 @@ diff -urp ../process/step9_try.txt ../process/stepA_mal.txt
returned that has its `meta` attribute set to the second argument. returned that has its `meta` attribute set to the second argument.
Note that it is important that the environment and macro attribute Note that it is important that the environment and macro attribute
of mal function are retained when it is copied. of mal function are retained when it is copied.
* Add a reader-macro that expands the token "^" to
return a new list that contains the symbol "with-meta" and the
result of reading the next next form (2nd argument) (`read_form`) and the
next form (1st argument) in that order
(metadata comes first with the ^ macro and the function second).
* Add a new "\*host-language\*" (symbol) entry to your REPL * Add a new "\*host-language\*" (symbol) entry to your REPL
environment. The value of this entry should be a mal string environment. The value of this entry should be a mal string