Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Asen Bozhilov
gaz Heyes : > Well you better stop doing that since it's a syntax error The other members pointed out what I meant. Yes, the first RegExp include "I" as a modifier. I posted first message trough my phone. Obviously I've leaved "Caps Lock" :( Sorry for the confusion: /^[A-Z_$][A-Z0-9_$]*$/I Shou

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Nick Morgan
On 6 September 2011 17:14, gaz Heyes wrote: > On 6 September 2011 16:55, Nick Morgan wrote: >> >> He said "Also when I use `i` modifier I always use upper case letters >> in RegExp literal because they are easier for reading", i.e. when he >> uses the `i` modifier he uses uppercase letters in the

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Nick Morgan
On 6 September 2011 16:49, gaz Heyes wrote: > > On 6 September 2011 16:32, Poetro wrote >> >> Asen means: >> >> /^[A-Z_$][\w$]*$/i > > Asen shouldn't have said "i" modifier then > He said "Also when I use `i` modifier I always use upper case letters in RegExp literal because they are easier for

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Poetro
2011/9/6 gaz Heyes : > On 6 September 2011 14:46, Asen Bozhilov wrote: >> >> Also when I use >> `i` modifier I always use upper case letters in RegExp literal because >> they are easier for reading. > > Well you better stop doing that since it's a syntax error Asen means: /^[A-Z_$][\w$]*$/i --

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Asen Bozhilov
gaz Heyes : > You could shorten that to: > /^[a-z_$][\w$]*$/i > > Much cleaner :P You are correct it's shorter, but personally I prefer previous variant of that RegExp. I think it's more verbose than `\w`. Also when I use `i` modifier I always use upper case letters in RegExp literal because they

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Dmitry Soshnikov
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) * (mu

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Asen Bozhilov
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 While this is for checking purposes you don't have to care abou the case of letters. Al

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Peter van der Zee
On Tue, Sep 6, 2011 at 12:46 PM, Pete Otaqui wrote: > Don't forget "nothing" (or "an empty string"): > > https://github.com/micmath/eMptyStringJS/blob/master/src/emptystring.js Although funny (and I actually did not know about it myself), it's not a valid identifier :) Just a valid property to us

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-06 Thread Pete Otaqui
Don't forget "nothing" (or "an empty string"): https://github.com/micmath/eMptyStringJS/blob/master/src/emptystring.js On 5 September 2011 19:43, Peter van der Zee wrote: > On Thu, Sep 1, 2011 at 6:49 PM, Dmitry A. Soshnikov > wrote: > > That's it -- while it perhaps perfectly correct, unf

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-05 Thread Peter van der Zee
On Thu, Sep 1, 2011 at 6:49 PM, Dmitry A. Soshnikov wrote: > That's it -- while it perhaps perfectly correct, unfortunately it will > complicate the article which is without it too big :( If you want to be picky about it (and I know you do ;), any "unicode letter" is valid as part of an identifie

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-01 Thread Dmitry A. Soshnikov
On 01.09.2011 20:49, Dmitry A. Soshnikov wrote: On 01.09.2011 20:44, gaz Heyes wrote: On 1 September 2011 17:25, Dmitry A. Soshnikov mailto:dmitry.soshni...@gmail.com>> wrote: Though, you can give me your regexp you think fits better for education article ;) Only of course it won't com

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-01 Thread Dmitry A. Soshnikov
On 01.09.2011 20:44, gaz Heyes wrote: On 1 September 2011 17:25, Dmitry A. Soshnikov mailto:dmitry.soshni...@gmail.com>> wrote: Though, you can give me your regexp you think fits better for education article ;) Only of course it won't complicate the things too much. Slightly compl

Re: [JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-09-01 Thread Dmitry A. Soshnikov
Yep. It's a simplified regexp (as much as possible). The main thing is not to complicate the explanation with complicated regexps, etc (since the source of an article is big by itself) -- this is an education language, not a production. Though, you can give me your regexp you think fits better

[JSMentors] "Essentials of interpretation" Lesson 5. Simple user-defined functions.

2011-08-31 Thread Dmitry A. Soshnikov
The next part of implementing an interpreter is out. "Essentials of interpretation" Lesson 5. Simple user-defined functions. https://github.com/DmitrySoshnikov/Essentials-of-interpretation/blob/master/src/lesson-5.js Dmitry. -- To view archived discussions from the original JSMentors Mailman l