r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[REBOL Syntax] Discussions about REBOL syntax

Ladislav
17-Feb-2012
[168]
that is not a valid path, but this one is:

>> type? second load "a/1.2.3/b"
== tuple!
Steeve
17-Feb-2012
[169]
That's right it makes the tupple valid which is wrong
Ladislav
17-Feb-2012
[170]
The tuple *is* valid, what is invalid is just the path in your example
Maxim
17-Feb-2012
[171]
no, it makes the PATH invalid.
Steeve
17-Feb-2012
[172x3]
what !!!!!!
I can't believe it
[1.2.3/b] = [1.2.3  /b]
it may be valid but it has nothing to do with a path anymore
Gregg
17-Feb-2012
[175]
Paths have to start with a word, don't they?
Ladislav
17-Feb-2012
[176]
path-syntax shall be something like path-syntax: [word-syntax some 
[#"/" value-syntax]]
Gregg
17-Feb-2012
[177]
Otherwise, they load as a block.
Maxim
17-Feb-2012
[178]
yep.  so the above is not a path   :-)   its a tuple, followed by 
a refinement.
Steeve
17-Feb-2012
[179x2]
Argh sorry
>> [a/1.2.3/a]
== [a/1.2.3/a]
valid path
Ok you"re right again with tuple!
Gregg
17-Feb-2012
[181]
Same for other types too. e.g. paren!
Steeve
17-Feb-2012
[182]
My last try.
It doesn't work with decimals
Maxim
17-Feb-2012
[183]
the key here really is that AND  ;-)
Steeve
17-Feb-2012
[184x3]
>> [a/0.3/a]
** Syntax error: invalid "decimal" -- "0.3"
** Near: (line 1) [a/0.3/a]
>> [a/0.3/a]
** Syntax error: invalid "decimal" -- "0.3"
** Near: (line 1) [a/0.3/a]
Ahaaaaaaaaaaaaa
Ladislav
17-Feb-2012
[187x2]
Hmm, this must be a LOAD bug, I think
>> type? second load "a/1.1"
== decimal!
Maxim
17-Feb-2012
[189]
its valid in R2
Steeve
17-Feb-2012
[190]
neither this in R3
>> [0.3/a]
** Syntax error: invalid "decimal" -- "0.3"
** Near: (line 1) [0.3/a]
Ladislav
17-Feb-2012
[191]
That really deserves a CC ticket
Andreas
17-Feb-2012
[192]
Looks like a bug indeed.
Ladislav
17-Feb-2012
[193]
>> a: [0.3 xxx]
== [0.3 xxx]

>> a/0.3
== xxx
Steeve
17-Feb-2012
[194]
So you got me with the "it's a bug !"
Okkkkkkkkk :)
Ladislav
17-Feb-2012
[195]
Well, I do not know exactly what to do now, there is an option to 
reflect the state in the DECIMAL-SYNTAX definition
Steeve
17-Feb-2012
[196]
At least it should be noted as a comment in the source
Ladislav
17-Feb-2012
[197]
yes
Steeve
17-Feb-2012
[198]
I still think there is a problem with that form [aaa/]

It will be checked like 2 separate valid words although it's an invalid 
path
Maxim
17-Feb-2012
[199]
btw, I was not able to use decimals in paths in R2.
>> a: [0.3 test]
== [0.3 test]
>> a/0.3
== none
Ladislav
17-Feb-2012
[200]
system/version?
Maxim
17-Feb-2012
[201]
2.7.8.3.1
Ladislav
17-Feb-2012
[202]
aha, in R2, OK
Maxim
17-Feb-2012
[203]
I'm thinking its a rounding/precision error.
Ladislav
17-Feb-2012
[204x3]
no, it looks like an unimplemented feature
(it is not possible to obtain different rounding when using 0.3 twice)
A change committed. "aaa/" is not accepted now, however, there are 
differences we should discuss.
Steeve
17-Feb-2012
[207x2]
I don't see the new commit, weird !
Hallo !
Ladislav
17-Feb-2012
[209]
corrected
Steeve
17-Feb-2012
[210x4]
Another thing...
a zero length word is valid with that rule
 
 -> word-syntax succeded
That way, word-syntax must have one character length à least
word-syntax: [
	[
		slash-word
		| more-less-word

  | and word-char opt sign [#"." | not #"'"] not digit any word-char
	]
	termination 
]
Ladislav
17-Feb-2012
[214]
good catch
BrianH
17-Feb-2012
[215x2]
>> load "a<a>"
== [a <a>]
Looks good to me.
There were some good reasons for the complexity of the rule in
Steeve
17-Feb-2012
[217]
Thanks I forgot to whine about that one