News for hackers. Stuff that matters.
Re:Ren: a lightweight data-exchange text format by jepler on Friday October 20, 2017 @12:01PM (#15516812)
It's cute that the spec believes money is denoted by "$".
Re:Ren: a lightweight data-exchange text format by evv on Friday October 20, 2017 @12:29PM (#15517058)
I'm confused.. why is this cute?

Of course "$" is used as the symbol for several currencies, but its not clear if you have a better symbol in mind for the generic concept of money.

https://en.wikipedia.org/wiki/$_(disambiguation)

Re:Ren: a lightweight data-exchange text format by jepler on Friday October 20, 2017 @02:37PM (#15518140)
Sarcastically cute. It appears very parochial (in the sense of "limited or narrow outlook") to think that having a single "currency type" is useful, or that using a "$" to denote it is appropriate. While "$" is used by at least one important world currency, I am pretty sure that more people use ¥ than $ by a long shot, and users of € are about as plentiful as people who spend in USD.

(The idea that in Rebol one might write EUR$1.00 to denote the value that would usually be written 1.00€ is also pretty horrible)

Re:Ren: a lightweight data-exchange text format by greggirwin on Friday October 20, 2017 @02:53PM (#15518283)
@jepler,

1) Do you agree that a notation should support currency values? That is, they are useful to identify in data, as atomic units?

2) If so, do you agree there should be a single standard symbol and lexical form used to identify them? Because if we don't do that, we have to support every localized notation, correct?

3) If you agree to both of those questions, what symbol do you suggest? ¤ is generic, but not on any keyboard layout I know of. Also, see Chris's note about ASCII priority.

Re:Ren: a lightweight data-exchange text format by jepler on Friday October 20, 2017 @05:37PM (#15519284)
No, I can honestly say I've never worked on a software project that dealt directly with currency values. Personally, in the kinds of projects I do, explicit support for units of measurement would be more beneficial: you'd like to use the type system to detect where units from different systems are mixed (e.g., km+mi) and behave appropriately by performing a conversion; or to detect where inappropriate units are mixed (e.g., kg+hz) and signal an error (at project build time if possible!)

With that background in mind, I imagine the scenario here you have two data in a Ren document which are both the literal $1.00, but one is actually 1.00USD and the other is actually 1.00EUR: it doesn't prevent errors (for instance, when you want to perform an operation like + on the two data), because you still don't know what the data means. You have gained very little over just using the literal 1.00 instead.

So if I were making a proposal I'd be tempted to suggest a syntax like [1.00 USD], and maybe even giving up one of the remaining sigils ^[1.00 USD] if it is important to raise to being a special element in the syntax of a Ren file. Now that you're saying what you mean, you can use the same syntax for all units: ^[1.00 kg m -2] (1 kilogram per square meter), ^[1.00 V hz -.5] (1 volt per square-root-hertz, a typical units specification of noise in opamps).

Re:Ren: a lightweight data-exchange text format by greggirwin on Friday October 20, 2017 @05:44PM (#15519321)
No need for special syntax. ^ is already the escape character. Just use blocks. Though a `unit` syntax has been brought up. The notation would use path syntax, but start with an number instead of a word. Frink, of course, is the king of languages in this regard.

And while this may be more beneficial in your work, a lot of software does have to deal with money, where it's important not to use floating point, but BCD or something else.

Re:Ren: a lightweight data-exchange text format by juki on Friday October 20, 2017 @04:22PM (#15518859)
> ¤ is generic, but not on any keyboard layout I know of.

Finnish (/ Swedish) keyboards have ¤ on `<Shift> 4` ($ is `<Alt Gr> 4`).

Re:Ren: a lightweight data-exchange text format by greggirwin on Friday October 20, 2017 @04:29PM (#15518908)
Thanks! Good to know.
Re:Ren: a lightweight data-exchange text format by XR0CSWV3h3kZWg on Friday October 20, 2017 @04:04PM (#15518752)
The use of $ is far larger than the US.

US: 325,365,189

Canada: 35,151,728

Taiwan: 23,550,077

Australia: 24,688,400

Ecuador: 16,385,068

Hong Kong: 7,374,900

El salvador: 6,344,722

Singapore: 5,607,300

New Zealand: 4,826,660

Liberia: 4,503,000

Jamaica: 2,881,355

Namibia: 2,113,077

East Timor: 1,167,242

Belize: 387,879

Micronesia: 104,937

Marshal Islands: 53,066

Palau: 21,503

Caribbean Netherlands: 25,019

460,551,122 in total. Which is still less than 50% of China's 1.4B

Re:Ren: a lightweight data-exchange text format by jepler on Friday October 20, 2017 @05:16PM (#15519156)
Yes, I tried to be careful in what I stated, but here's what I meant: "$" is the everyday currency symbol of far fewer people than "¥". "USD" is the everyday currency of only about as many people as "EUR"
Re:Ren: a lightweight data-exchange text format by XR0CSWV3h3kZWg on Friday October 20, 2017 @05:18PM (#15519167)
Yeah well done, when I first looked at the list of countries I figured they might add up to ~1B, but they didn't even come close!

It's easy to forget just how much bigger China is.

Re:Ren: a lightweight data-exchange text format by greggirwin on Friday October 20, 2017 @01:01PM (#15517320)
What do you suggest? ¤ is really the only other option, but $ seems much more universal, if you can choose only one.
Re:Ren: a lightweight data-exchange text format by rgchris on Friday October 20, 2017 @01:34PM (#15517617)
For the most part, Ren is delimited by ASCII characters. Rebol permitted a three-letter code to denote currency: USD$10 GBP$15
Re:Ren: a lightweight data-exchange text format by lmm on Friday October 20, 2017 @12:32PM (#15517074)
In another context it might be cute; with the weeaboo name it's rather horrifying.