Yes, thanks everyone for takes on identifier regexps, maybe I replace it
with some even more simpler (seems \w is better).
In general, our identifiers include more complete subset of characters
than identifiers in JS. For example:
+ (addition function name)
- (subtraction function name)
* (mult)
null? (the predicate to test whether a value is null)
set! (a setter which modifies a value)
hello-world (simple user-defined function consisting of two words)
etc.
are all valid identifiers in this language.
Another question I have. What about simplicity of a material in general?
Is it a hard lesson (or maybe the series in a whole)? Of course the
series requires already some experience (how practical and as well
theoretical) in programming, but nevertheless -- in your opinion -- what
is the most hard things to understand, what are the easiest?
I'm glad to see several forks with own very interesting implementations.
Besides, I'm glad to receive some questions and proposals for
improvements. However, I'd like to analyze more deeply -- whether it
makes sense to make the lessons more detailed but spitted even more on
sub-chapters? Will it improve the readability and understandability? Or
the way it is now is enough?
Once again, the main goal is to make the lessons as easier as possible
(while keeping academic approach); to show the generic principles of how
interpreters work. And _then_ people can implement own with much more
correct and full regexps for identifiers, etc. ;)
Dmitry.
On 06.09.2011 16:35, gaz Heyes wrote:
On 6 September 2011 13:14, Asen Bozhilov <[email protected]
<mailto:[email protected]>> wrote:
Instead of Unicode support, ASCII letters in educational article
are completely enough. You can split identifiers in two parts.
First letter and everything else. So the RegExp would be:
/^[A-Z_$][A-Z0-9_$]*$/I
You could shorten that to:
/^[a-z_$][\w$]*$/i
Much cleaner :P
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]