5 ms·
Exactly. AFAIK, it has small core language and all other constructions like if/else, while, for, foreach etc are made with macros. I think that Nemerle is Lisp
by kung-fu-master 15y ago
Exactly. AFAIK, it has small core language and all other constructions like if/else, while, for, foreach etc are made with macros.
I think that Nemerle is Lisp macros + static types + OCaml (algebraic data types, pattern matching) + .Net ecosystem (even Visual Studio support).
- andrewcooke 15y agohow does it square typing with macros? is it typed after macro application?
- ziaw 15y agoyes, but macros can operate with typed AST too
- hi_octane 15y agoThere are different "macro stages" to allow macro application on both typed and untyped source.
- andrewcooke 15y agoso if macros can operate on typed source and/or on the typed ast tree, do they (the macros) have a type system that guarantees that they will preserve correct typing? or are types still checked agan (globally?) after applying the macro? what i'm really asking is, is there anything "smart" about how the macro works with the type system?
- VladD2 15y agoMacros are expending in the typing process. In macro you can use compiler API to type some untyped AST (for example, argument of macro). For example, "foreach" macro use compiler API to infer type of collection. This macro generate specialized code for different collection kind (array/list/IEnumerable).
- VladD2 15y agoFor example, see implementation of "lock" macro: http://code.google.com/p/nemerle/source/browse/nemerle/trunk/macros/core.n#434 http://code.google.com/p/nemerle/source/browse/nemerle/trunk...