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

World: r3wp

[!REBOL3-OLD1]

Ammon
25-Mar-2009
[12308x2]
I'm seeing some strange behavior with Parse...

ws: charset rejoin [space tab newline]

parse "   This is a test!" [s: some ws e: (probe copy/part s e) to 
end]
; == false

parse/all "  This is a test!" [s: some ws e: (probe copy/part s e) 
to end]
; "  "
; == true

I shouldn't need /all when I provide a rule block should I?
In truth it doesn't always fail but I'm not sure what causes it to 
change it's behavior.
Ammon
26-Mar-2009
[12310]
Heh.  Or rather I don't know why SOME was ever working but I saw 
it work once.


parse "  ^- this is a test!" [s: any ws e: (probe copy/part s e) 
to end]

ANY appears to work all the time though.  Strange.
Steeve
26-Mar-2009
[12311]
charset is bugous in R3 currently
Ammon
26-Mar-2009
[12312]
So this is a problem with Charset not Parse?
Steeve
26-Mar-2009
[12313x3]
I made my own function.
charset: func [str /local bitset][
	bitset: make bitset! 256
	foreach char str [append bitset char]
]
to be right, is used this to make complement of charsets
you made a mistake bout the understanding of /all refinement, see 
help
Ammon
26-Mar-2009
[12316]
You're not making much sense.
Steeve
26-Mar-2009
[12317x3]
Sorry, i mean, forget my charset function. your problem is the missunderstanfing 
og /all refinement
/all -- Parses all chars including spaces.
if not, spaces are skiped.
spaces are : space, newline, tab
Ammon
26-Mar-2009
[12320x2]
Yeah, I read that part.  For some reason I thought parse didn't skip 
whitespace if you provide a block but this clearly shows otherwise...


>> parse " a b c ddd " [ "a" (print 'a) "b" (print 'b) "c" (print 
'c) some "d" (print 'd)]
a
b
c
d
== true
But why does ANY work without /all while SOME doesn't???
Steeve
26-Mar-2009
[12322x2]
because any is an optionnal rule not some
basics
Ammon
26-Mar-2009
[12324]
That doesn't make sense to me still.  If the parser is skipping whitespace 
unless you use /all then any should fail the same way that some does.
Steeve
26-Mar-2009
[12325]
No, Optionnal means that if ANY fails , the parsing process continue 
with the next rules
Ammon
26-Mar-2009
[12326]
Ah, but ANY didn't fail.  The paren was evaluated which means that 
ANY succeeded.
Steeve
26-Mar-2009
[12327]
show me your code
Ammon
26-Mar-2009
[12328x2]
But whatever.  I have what I need and as long as parse is behaving 
as Carl intended then, whatever...
I posted the code a few messages back.
Steeve
26-Mar-2009
[12330x3]
Then, it's not related, the parent is not associated with the ANY 
rule. So that, the ANY rule can failed and the parent will be executed 
each time
cardinality of ANY is  0,N
cardinality of SOME is 1,N
I changed my mind, i uses the default caret and highlight behavior, 
much simple.
shadwolf
26-Mar-2009
[12333]
Ammon some doesn't work for SOME reason   ^^ .... probably  ^^
Graham
27-Mar-2009
[12334]
Most widgets are rectangular in shape ... any reason for this?  Are 
other shapes feasible?
Pekr
27-Mar-2009
[12335]
So far, there is not much widgets, which could have different shape, 
no?
Graham
27-Mar-2009
[12336]
Lack of imagination?
ICarii
27-Mar-2009
[12337]
edge / hgit testing is the main reason
Graham
27-Mar-2009
[12338]
easier computationally?
ICarii
27-Mar-2009
[12339x2]
much
you have to use alternative methods like colour testing for non-regular 
shapes
Graham
27-Mar-2009
[12341x2]
well, what can you do with quad core cpus ??
I've watched those multitouch demos ... seem to use irregular shapes
ICarii
27-Mar-2009
[12343x2]
ill dig out my radial menu thingy and update it for r3 and test it 
for speed.. have a old version at http://rebol.mustard.co.nz/readial.tar.gz
http://rebol.mustard.co.nz/radial.tar.gz.. oops
Graham
27-Mar-2009
[12345]
Ok, that is cute
ICarii
27-Mar-2009
[12346]
meh - ive done it in assembly before - its rather sad in rebol :(
Graham
27-Mar-2009
[12347]
though I suspect it's not working ... I only see shapes and no text
ICarii
27-Mar-2009
[12348]
its 2003 - back before the text in agg changed
Graham
27-Mar-2009
[12349x2]
ahh...
I'm surprised you were able to find it so quickly!
ICarii
27-Mar-2009
[12351]
i downloaded my website today to look for some old sudoku code :P
Graham
27-Mar-2009
[12352]
Silverlight is starting to use radial menus too
Chris
27-Mar-2009
[12353]
My Daylight Map used color to detect irregularly shaped hit spots...
ICarii
27-Mar-2009
[12354]
yeah colour testing is fast and maps nicely to functions
Graham
27-Mar-2009
[12355]
Are you still working on your own graphics system for R3?
Chris
27-Mar-2009
[12356]
http://ross-gill.com/r/daylight/map.jpg
http://ross-gill.com/r/daylight/map-zones.png
ICarii
27-Mar-2009
[12357]
im waiting for Carl/Cypher to fix some of the view holes.. and also 
for modules and timers and threads :P