World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Steeve 24-Mar-2009 [12285] | http://sites.google.com/site/rebolish/ |
Henrik 24-Mar-2009 [12286] | thanks. maybe it's better to implement it as a scheme anyway. |
Gregg 24-Mar-2009 [12287] | I'm confused on your proposal as wel Henrik. A concrete example would really help, since it's a complex concept. |
Henrik 24-Mar-2009 [12288] | I think I'll wait. I've discovered some problems with the idea, which makes it less useful than I thought it would be. |
Pekr 25-Mar-2009 [12289] | There is new blog about small change to modules - http://www.rebol.net/r3blogs/0179.html |
Steeve 25-Mar-2009 [12290] | Eh Ammon ! how do you manage selection over several text gobs ? I'm trying to do it currently, but i'm not sure to have the best design |
Ammon 25-Mar-2009 [12291] | I haven't gotten that far yet. I recently had to rewrite my parser from the ground up, mostly due to the fact that NOT isn't implemented yet and I want to be able to handle unicode without too much trouble. I think I'm going to have to handle a lot events like text selection by passing them through the text faces to the main scrollable area and let it handle them. I expect I'll be rewriting the highlighting from the ground up. |
Steeve 25-Mar-2009 [12292] | i'm rewritting completly the key handler with my own cursor (a gob). I don't like the default handler |
Ammon 25-Mar-2009 [12293] | I like the design of the default handler. =D I'll need to modify or extend it before I'm through though. |
Steeve 25-Mar-2009 [12294] | too much ovverrides have to be done, redoing it from the scratch is simpler |
Ammon 25-Mar-2009 [12295] | You know that you can get the source from DevBase, right? |
Steeve 25-Mar-2009 [12296x2] | my cursor is gob i'm moving from gobs to another gobs |
i have the sources | |
Ammon 25-Mar-2009 [12298] | Yup, I'll be doing that as well. |
Steeve 25-Mar-2009 [12299] | in the default design, the cursor is not a gob |
Ammon 25-Mar-2009 [12300] | well, the handling of text editing is very powerful. I will definitely be using the same design just extending it a bit. |
Steeve 25-Mar-2009 [12301x2] | i don't like it so much ;-) |
but perhaps i'm wrong | |
Ammon 25-Mar-2009 [12303] | It's a simple state machine. It's taken me a long time to grok what can be done with such a system but now they are starting to dominate my code. |
Steeve 25-Mar-2009 [12304] | A state machine ? What a big word. It's just a serie of switch commands :-) |
Ammon 25-Mar-2009 [12305] | Instead of having to add a lot of refinements and refinement handling to related functions you can just put them together into an object and as each of the functions are called they are setting values that are local to the collection of functions and each of those values modify the behavior as if you were using refinements and passing in more values. It's kind of an inference engine. |
Steeve 25-Mar-2009 [12306] | Again, what a big word. I do that too to have a more readable, and compact code. I don't like to pass thousand of parameters. But nothing is related to a state machine to my mind |
Ammon 25-Mar-2009 [12307x3] | You may be right. I may be misinterpreting the meaning of state machine... |
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? |
older newer | first last |