5 ms·
To clarify: - unevaluated expressions are called blocks, and with them the line between code and data blurs, since you can treat block as either one at any tim
by 9214 9y ago
To clarify:
- unevaluated expressions are called blocks, and with them the line between code and data blurs, since you can treat block as either one at any time (homoiconity);
- there're no scopes, only namespaces (contexts);
- yes, Parse is one of the Red's crown jewels, many people (and author of the article himself) treat it as some kind of "plain English regex", while in fact it's not limited only to string parsing, but can be applied to any other series-like value and code (i.e. blocks) itself, which allows for some cool metaprogramming tricks;
- R/S (without any optimization layers whatsoever) is 2-3 times slower than C.
- shalabhc 9y agoThanks for the clarifications. > it's not limited only to string parsing, but can be applied to any other series-like value and code (i.e. blocks) itself Sounds somewhat similar to OMeta (http://www.tinlizzie.org/ometa/ http://www.tinlizzie.org/ometa/) which can pattern match streams of objects. With contexts it sounds like almost every word can be late bound? Also it seems blocks and contexts are decoupled which means you could evaluate multiple blocks from different parts of your program in the same context, or give each a unique context, etc?
- 9214 9y agoEvery word (the thing what author calls a "variable") has a binding. In short, it's a pointer to the namespace where value associated with that word resides. Blocks can nest any other value, including words. At any point in runtime you can change this pointers (bound word to some value) for every word in a block or for separate words.
- greggirwin 9y agoYou can pattern match streams of values, and those values can be any lexical form that Red supports.