Closed IngoHohmann closed 4 years ago
This is by design...to avoid people using #;
to try and get a semicolon character and getting unexpected results.
Since ;
are legal in things like URLs generically, I don't think people should be putting them up against things... one space off is a minimum, but I prefer 2 in practice.
I do get your point, and why isn't ";" allowed in issues!s, if it is allowed in text!?
And shouldn't this be changed to ";"
>> last "abc;"
== #;
Though we all know, that molded data does not necessarily have to be loadable, this seems a bit unfortunate to me:
>> load mold last ";"
(i) Info: use WHY for error information
** Syntax Error: invalid "issue" -- "#"
** Where: transcode if load console
** Near: (line 1) #;
** File: --anonymous--
** Line: 1
why isn't ";" allowed in issues!s,
It's allowed, it just needs quotes around it. So do ] and ( and things like that.
Though we should consider if #paired(cases)should[be]legal...and URLs have a similar question.
And shouldn't this be changed to ";"
Yep, good point. It needs to be unified with the FILE! code for making the decisions about whether to put things in quotes or not, and all that needs to be better.
Glad you're looking at it, and if you want to work on putting together tests that would be great... I'd like to see more things like this one, which was a precursor to the unification:
If we have some of those for what MOLD expectations are, it would be great.
Though we all know, that molded data does not necessarily have to be loadable,
I'd like that to be as true as it can be; even to the point of having a debug mode where LOAD always internally does one pass of molding what it got in out, and then reloading it and comparing to see it's identical...
So generally, assume any problems with that are just something not gotten around to yet.
To be clear: I would probably prefer it if semicolons were only considered comments if they had space to their left:
# ; empty issue with comment
#; ; a single-character semicolon issue!
Considering the general principles of space-separation in the language, that seems an easy-enough rule to absorb. It would suggest that a;b and a; b would be errors, which I'm personally fine with. Though I have seen some cases where the no-op of semicolon-ness has been taken advantage of to LOAD foreign notations which were mostly compatible...but needed semicolon as an end-of-line marker. :-/
But without that rule in place for the rest of the language, it makes sense for ISSUE! to error here, and ask you to write #";"
But it is in effect for some of the rest of the language:
>> http://www.abc.de/look;
== http://www.abc.de/look;
And I feel issue! is conceptually nearer to url! than to word!
But it is in effect for some of the rest of the language:
I actually hadn't checked to notice URLs were doing that (Rebol2 and Red do not). Apparently neither does R3-Alpha, so this is something that was hacked into Ren-C at some point.
It seems to me that implementing a space-significance rule for comments is probably the best answer. Went ahead and tried doing that.
As much as I'd like to write tests all day for these things, there's a pile of stuff to do...
...so I can really just start it off, add some if you feel inclined: