Skip to content

Commit

Permalink
Generalize note for with-meta (guide, Step A)
Browse files Browse the repository at this point in the history
The bullet point for `with-meta` describes how to implement it for Mal functions, but it's applicable to all Mal types, while the last sentence can be reordered to emphasize the details specific to metadata on functions.
  • Loading branch information
dfuenzalida authored and kanaka committed Aug 9, 2024
1 parent 47395d7 commit a1f1a72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions process/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1661,11 +1661,11 @@ implementation.
* `meta`: this takes a single mal function/list/vector/hash-map argument
and returns the value of the metadata attribute.
* `with-meta`: this function takes two arguments. The first argument
is a mal function/list/vector/hash-map and the second argument is
another mal value/type to set as metadata. A copy of the mal function is
returned that has its `meta` attribute set to the second argument.
Note that it is important that the environment and macro attribute
of mal function are retained when it is copied.
is a mal value and the second argument is another mal value/type
to set as metadata. A copy of the mal value is returned that has
its `meta` attribute set to the second argument. Note that when
copying a mal function, it is important that the environment and
macro attribute are retained.
* 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
Expand Down

0 comments on commit a1f1a72

Please sign in to comment.