| Article: |
Exploring E4X with Ruby | |
| Subject: | Nice Idea | |
| Date: | 2004-10-15 12:41:03 | |
| From: | jherr2002 | |
|
Response to: Nice Idea
|
||
|
Excellent. Thanks.
|
||
Showing messages 1 through 2 of 2.
-
Nice Idea
2004-10-15 21:36:12 HotFusionMan [View]
-
Nice Idea
2004-10-15 21:50:43 Jack Herrington |
[View]
Thanks. My pleasure.
My guess is that outside of a string literal it would be difficult to get Ruby to look at any operator symbol as anything other than just the operator.
I haven't tried something like this though: foo."-bar"
I'd try it out but I need some sleep.
I actually talked with the guys that did the E4X work in Javascript. They did a LOT of work in the tokenizer and lexical analyzer to support the entire XML standard in Javascript.



The dash-in-name remark reminds me of something -- I think the same issue arises in the cLabs Internet Explorer Controller (mentioned in one of the files in its distribution if I remember correctly, not directly on its Web pages).
At least for this case, if the Ruby interpreter required whitespace around the "-" method in calls, that might disambiguate this type of name from the minus operator/method. But I guess that would break the (admittedly rarely seen) syntax
foo.-barorfoo.-(bar).