Re: value() problem maybe
- Posted by slowmaker Apr 10, 2013
- 1433 views
value() has not caught up to the newer 4.0 style literals. Use Euphoria 3.1 literals instead. If you really want it, you can always look at the code in std/get.e and fix it yourself if it is not a builtin now.
Shawn Pringle
Okay, here's the start of my attempt: http://openeuphoria.org/pastey/209.wc (do we have a way to attach files? not sure pastey is the appropriate thing for me to do here)
I took a swing at updating get.e to match the documentation. Here are the changes in this version:
modified char() type range in get_ch(), changed: if ch = GET_EOF then to if ch != GET_EOF then in skip_blanks(), changed to a function returning count of whitespace skipped changed Get2() to get_verbose() and made it mostly a call to Get() with only the extra data manipulation occuring in get_verbose() added support for: sequence terminator $ new escape sequences \e, \E, \0, \b, \x, \u, \U raw strings (built around Matt Lewis's get_heredoc()) """ """, ` ` hex string specifiers x"FEED" binary string specifiers b"BEEF" ignoring block comments /* */ underline spacers in numbers 123_999_000 binary number notation 0b10101010 hex number notation 0xBEADFADE octal number notation 0t01234567 decimal number notation 0d9876543210 various other changes made necessary and/or convenient by the changes listed above; new support functions, miscellaneous tweaks made while bug chasing (WinMerge, diff, etc. will make your life easier there).
I also made one change (mistakenly) that does not match the docs but which I decided to keep and make into a feature request http://openeuphoria.org/ticket/865.wc:
This version does not require whitepace between Euphoria objects, except where the nature of the object automatically enforces it (e.g. if you butt two numbers together, obviously they will be interpreted as one, which you presumably don't want; neither this version or the old one is telepathic, can't foresee that...).
This was originally simple forgetfulness. I didn't remember that requirement from the docs, and just assumed it should be able to handle stuff like 1234"string" as two consecutive objects. By the time I noticed that part of the docs, I already had it working, so I am requesting that everybody mull that one over as a possible official behavior change (ticket should hopefully be entered by the time you read this).
So...bug reports definitely welcome; I have only done rudimentary bug testing. I will try to attend to them when and as I can, just bear in mind that my screen name is fairly accurate.