forum-msg-id-126384-edit

Original date:2015-01-21 06:19:32 Edited by: SDPringle Subject: POLL: What should value do with underscores?

The interpreter can read things like "2e10_000" and "#DEAD_BEEF". It can read values as hexadecimal, decimal, octal, and even binary. Okay, now although the interpreter might be able to handle special formatting of numbers, that does not necessarily mean that an application written in EUPHORIA should handle '_' this way or handle specially strings like "0b0" at the beginning of the number when it uses value() or get().

So, my question is to you all is, should any literal that is readable by the interpreter be readable by the routines value() and get() the same way?

Should the following be equivalent?

  • value("1024") ,
  • value("1_024"),
  • value("0b100_00000000"), -- 1024 in binary BTW
  • value("#400"), -- 1024 in hex
  • value("0q2000") -- 1024 in octal

Currently, value does not regard '_' as a possible part of a number and parses decimal, hexadecimal and scientific notation but neither octal nor binary.

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu