-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds test cases for add/set_symbols and add/set_macros #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
// add_macros does not have any side-effects on the symbol table | ||
// add_macros should append its arguments to the macro table of the default module | ||
// annotations on any argument value should signal an error (because it's not allowed in the macro table rather than because of any specific validation by the add_macros macro) | ||
// TODO: add_macros can accept a module name (of a loaded module) as an argument? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so. The options would be:
(macro name () body)
to define a macro in-situ.macro_ref
(qualified or unqualified) to add an already-defined macromodule_name::*
to add all ofmodule_name
's exported macros
Note that foo
would be considered an unqualified macro name rather than a module, which is why foo::*
exists.
(toplevel '#$1' '#$65' '#$66') | ||
(produces '$ion' 'make_field' '')))) | ||
|
||
(ion_1_1 "add_symbols can accept" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, I think add_symbols
and set_symbols
would also be able to accept module_name::*
.
// TODO: set_macros can accept a module name (of a loaded module) as an argument? | ||
// TODO: set_macros can accept a module/macro export? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thoughts as on add_macros
.
(ion_1_1 "set_symbols can be invoked" | ||
(each "in text with an unqualified macro name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment RE: module_name::*
.
(each (text "(:$ion::add_symbols)") | ||
(text "(:$ion::add_symbols 'a')") | ||
(text "(:$ion::add_symbols 'a' 'b')") | ||
// TODO: If it's not too difficult, assert that no macros are added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just assert that attempting to invoke (:1)
fails due to an unknown address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but I'm going to wait for the dust to settle on the Modules part of the spec first.
Co-authored-by: Zack Slayton <[email protected]>
Co-authored-by: Tyler Gregg <[email protected]> Co-authored-by: Zack Slayton <[email protected]>
Issue #, if available:
#88
Description of changes:
Adds test cases for
add_symbols
,set_symbols
,add_macros
, andset_macros
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.