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

World: r3wp

[REBOL Syntax] Discussions about REBOL syntax

Maxim
24-Feb-2012
[346]
I don't see to recognise the serialized version of the few datatypes 
which have it...
 #[true] #[false] #[none] [#function [][] ]  [#object [] ]
Steeve
24-Feb-2012
[347]
yep
Cyphre
24-Feb-2012
[348]
image!
Maxim
24-Feb-2012
[349]
#[list![]]  #[hash![]]
Steeve
24-Feb-2012
[350]
Okkkkk, there is a huge list for the serialized ones ;-)
Maxim
24-Feb-2012
[351]
money!    1.00%
Steeve
24-Feb-2012
[352]
percent!
Cyphre
24-Feb-2012
[353x2]
date! time!...
bitset!...
Maxim
24-Feb-2012
[355]
path! set-path! lit-path!
Steeve
24-Feb-2012
[356]
Well...
Cyphre
24-Feb-2012
[357]
just write: ? datatype! in the console to get some list
Steeve
24-Feb-2012
[358]
I will focus on the annoying ones for now
Maxim
24-Feb-2012
[359]
date has many variations, its probably the more complex one left
Steeve
24-Feb-2012
[360]
yep
Maxim
24-Feb-2012
[361]
actually,  path! also has a few quirks, like allowing parens and 
the use of a  get-set-word at the end
Steeve
24-Feb-2012
[362]
but path! needs all the other dataypes to be finished first
Maxim
24-Feb-2012
[363x2]
no, afaik,  just paren!, word and its own additional format quirks. 
    as the global block definition expacts, so too will parens, and 
thus the path.
expacts... expands
Steeve
24-Feb-2012
[365]
So, path! is not complex in that regard (values separated by '/')
Maxim
24-Feb-2012
[366]
yeah, just have to find the values which are valid in a path (not 
all types are valid, at least in R2)
Steeve
24-Feb-2012
[367]
Agreed
Maxim
24-Feb-2012
[368x2]
tag! yes, string! no.   for example:

>> block: [55 "abc" [test] <tag> [test]]
== [55 "abc" [test] <tag> [test2]]
>> block/"abc"
** Syntax Error: Invalid path -- block/
** Near: (line 1) block/"abc"
>> block/("abc")
== [test]
>> block/<tag>
== [test2]
I bet you didn't know tags where usable directly  ?  not many think 
about it, but since tags are strings, they make a lot of sense for 
representing XML tree structures... and indeed, I used them when 
I had namespaced tags.
Steeve
24-Feb-2012
[370]
Sorry, I knew ;-)
Maxim
24-Feb-2012
[371x2]
hehe.  but it may adds another complexity to the  <  parsing rule 
maybe some precedende in the rule will be required to make sure the 
this/<tag> isn't short-circuited by another simpler rule.
maybe some precedende in the rule == .  Maybe some precedende manipulations 
in the rules
Steeve
24-Feb-2012
[373]
Ok, I will go first with time! because date! needs it
Maxim
24-Feb-2012
[374]
remember that there are two different time formats.
Steeve
24-Feb-2012
[375]
Say ?
Maxim
24-Feb-2012
[376x2]
[ ##:##:## opt [decimal]] |  ##:## ]
actually... strike that... I just discovered how twisted the loader 
is .
Steeve
24-Feb-2012
[378]
Oh, there are more weird forms than that ;-)
Maxim
24-Feb-2012
[379]
I just discovered that this is valid:
>> 3:3.4
== 0:03:03.4
a dangerous gotcha since:
>> 3:3
== 3:03
Steeve
24-Feb-2012
[380x3]
:0
0:+
-1:0
uhuh
lol
>> :111111
== 1851:51
Maxim
24-Feb-2012
[383]
maybe we can note to this effect within the comments, to indicate 
how the time shifts when two or three number values are in the time.
hehe I can see a noob scratching his head  ;-)

3:03     == 3:03:00  
3.03.4  == 0:03:03.4
Steeve
24-Feb-2012
[384]
fast division by 60
Maxim
24-Feb-2012
[385x2]
wow this one is vile:
0:+
its ironic that the above will load but that a single comma with 
kill the loader   :-)
Steeve
24-Feb-2012
[387x2]
I can't use the time! rule inside date!, the allowed forms are different.
Youpiiiiiiiiii
Trolololol :)))))

time-syntax: [
[
	and [#":" digit]		; :##  
	| sign			; +:, -:
	| opt sign some digit   : +-##:
]
1 2 [
	#":" not #"." [
		opt #"+" any digit #"." any digit not #":"	; :+##.##
		| #"-." any digit not #":"				; :-.##:
		| opt #"+" some digit				; :+##:
		| #"+"						; :+:
		| #"-" any #"0"					; :-00:,  :-:
	]
] termination
]
Maxim
24-Feb-2012
[389]
simple enough   ;-)
Steeve
24-Feb-2012
[390x5]
Only if it works
not tested on R2 though
All that complication because 'minus' is allowed where it makes no 
sense
Missed one case already...
time-syntax: [
[
	and [#":" digit]		; :##  
	| sign				; +:, -:
	| opt sign some digit   : +-##:
]
1 2 [
	#":" not #"." [
		opt #"+" any digit #"." any digit not #":"	; :+##.##
		| #"-" any #"0" #"." any digit not #":"		; :-00.##:
		| opt #"+" some digit				; :+##:
		| #"+"							; :+:
		| #"-" any #"0"					; :-00:,  :-:
	]
] termination
]
Ladislav
6-Mar-2012
[395]
Committed, did not check it, though.