Re: A Puzzle in Eu -- what would you do?
- Posted by cklester <cklester at yahoo.com> Aug 05, 2005
- 529 views
DB James wrote: > > > What if the line contents above were this?: > line=InnocentRtn("--In Eu, a comment begins with 2 hyphens") --A real comment > > The "x" would report the first "--" and miss the real comment (oops). > > The puzzle: > How do *you* deal with this? In this case, just reverse the string first. Then, the first set of '--' is the real comment. Snip it, reverse it back, and carry on. x = "code --fake comment -- real comment" becomes x = "tnemmoc laer -- tnemmoc ekaf-- edoc" then becomes x = " tnemmoc ekaf-- edoc" which finalizes to x = "code --fake comment " -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/