Comments (2)
syntax-e
and syntax->datum
were discussed earlier, in 3.1: syntax->datum
is syntax-e
applied recursively.
You could use syntax->datum
here instead. But using syntax-e
expresses that we expect the syntax to be an identifier that results in a symbol. And if it isn't, there will be a compile-time error.
(The error message will talk about stuff inside the macro implementation, which isn't very helpful to a user of the macro. (We discuss that later. Hint: Using syntax-parse
with the id
class would be wonderful.) But at least it will be most proximate to the problem inside the implementation, i.e. it will "go wrong quicker".)
Does that help?
from fear-of-macros.
OK, I see. It looks to me like the compile-time error is the same, whether you use syntax->datum
or syntax-e
, but I guess avoiding the recursive application is a little more efficient, perhaps. It was just that the earlier definitions of hyphen-define/...
in the sections above all used syntax->datum
but at that point it switches to syntax-e
and I wasn't sure if there was some special reason that syntax->datum
couldn't be used there as well. Thanks!
from fear-of-macros.
Related Issues (20)
- Backtick & comma introduced w/o explanation HOT 1
- syntax-case: unbound identifier HOT 1
- Thanks for this HOT 1
- Error in section 4.3 dot notation macro HOT 4
- Archival URL? HOT 2
- hash.refs macro with errors HOT 2
- Clarification on datum->syntax first argument
- Add a link to syntax-parse-example
- format-id examples are sloppy HOT 1
- unnecessary #` in "4.1.4 Another example" ? HOT 2
- Typo in README
- unbounded chain in revised hash.refs macros, section 4.3 HOT 1
- [question][3.1]having difficult time understanding define-syntax?
- Simplified Chinese Translation
- Katakana misspelling of “Transformer” HOT 3
- Emacs comment in Section 4.1 HOT 2
- dec HOT 1
- no mention of racket on main page HOT 1
- Zen saying translation is incorrect HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fear-of-macros.