World: r3wp
[Core] Discuss core issues
older newer | first last |
Henrik 25-May-2007 [8196] | found the bug. (and I need more coffee) |
Sunanda 25-May-2007 [8197] | There were problems with using all three refinements [ /all/compare/skip ] together in earlier versions of REBOL. I believe they are fixed now. |
Henrik 25-May-2007 [8198] | I think the compare feature is just a bit underdocumented. |
Rebolek 25-May-2007 [8199x2] | Script error: REPLACE has no refinement called ONLY |
I can use CHANGE/ONLY FIND ... What do you think, skould I RAMBO it as a wish? | |
Henrik 25-May-2007 [8201] | rebolek, yeah, I think it would make sense to have that. |
Rebolek 25-May-2007 [8202] | It's mezanine, so I'll try to figure out some fix and post it. |
Henrik 25-May-2007 [8203] | cool |
Rebolek 25-May-2007 [8204x3] | Hm, was easier than I thought :)) |
Posted | |
>> regexp "[hello-:-world-:-re]" "[a-z0-9._%-]+@[a-z0-9.-]+\.[a-z]{2,4}" == true ;)) | |
BrianH 25-May-2007 [8207] | Anyone else want a regex compiler that generates parse rules? Semantically, regex is a (very) limited subset of parse so it shouldn't bee too hard. |
Rebolek 25-May-2007 [8208x3] | I working on it right now. the above example is copied from console |
some things are not implemented yet and there some small problems but I hope I can solve them | |
I was looking for something, but nothing seems to exist. So I started mine, I'll release some first version soon. | |
Gregg 25-May-2007 [8211] | http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=like.r |
BrianH 25-May-2007 [8212x3] | The reason that regex compilers for REBOL are rare is that parse is more powerful than regex, and most people who start trying to implement regex usually learn enough about parse during the course of doing so that they switch to using parse instead :) |
Still, if you want help, a tester or a second opinion, post your code on the Parse group and we will optimize it for you. | |
It's funny, there's no better optimizer than the members of this world trying to show off and one-up each other :) | |
Gregg 25-May-2007 [8215] | I love this community. One of my favorite things is the ML threads that optimize code and bring out different perspectives on design. |
Terry 1-Jun-2007 [8216] | Hey... what's the code to prevent the security from popping up in windows? added -s to a shortcut, but not working? |
Gabriele 1-Jun-2007 [8217] | -s should work... |
Maxim 1-Jun-2007 [8218x8] | in 98% of cases I agree with what Brian just said about Parse being more powerfull than Regexp. but in those 2% regexp is SO much more powerfull, that it still has its place. now some of you will ask me to say when or why, (I know how we as rebolers think and like to challenge each other ;-) but I cannot give an exact example, but having had to implement a few complex systems in both, I remember a few times in parse when I'd remember how a single char would replace 2-3 lines of parse "tricks". |
so, having a regexp WITHIN parse would be oh so incredible. especially since Parse allows such an easy way to traverse data at such a fast rate. having regexp to take "decisions" would scale pretty nicely. OTOH having rebol to take decision could be an alternative too. | |
Parse is good at matching, but sometimes, a simple condition "means" something which is hellish to implement as a set of explicitely mutually-excluding matches. regexp is a little easier in this case (note I use easier not in style or readability here... just in raw expressiveness). | |
if we could add a conditional within the dialect of parse directly (without using tricks, which I know many will be tempted to demonstrate, and many which I already know about) then parse itself would have another level of expressiveness IMHO. | |
one example could be to use the return value of evaluated parens as a "matched? or not" in order to continue in a parse rule. | |
this would allow us to make much simpler rules sometimes, especially when such decisions are not based on simple left to right loading of values, but sometimes based on interdependent values, which only take meaning once certain patterns have been loaded. | |
for example, not only the type and shape of data, but its actual value? have I loaded enough of this, for this rule to qualify. is a specific attribute set to a mandatory value? there are many such examples. | |
again, I know most patterns CAN be described using parse, but in many occasions, what could have been a simple parens with a decision and 2 or 3 very simple rules, ended up being a complex tree of tens or more rules, which have non obvious interdenpendencies and things like left entry recursions (I hope I make sense here) which are, well, slow(er) and hard to map in one's mind. | |
Terry 1-Jun-2007 [8226] | regexp should be shot |
Chris 2-Jun-2007 [8227] | Max, could you flesh that out as a hypothetical example? |
Maxim 2-Jun-2007 [8228] | are you asking me to give an example? |
Chris 2-Jun-2007 [8229] | Sure, how would it look? |
Maxim 2-Jun-2007 [8230x2] | well, I guess the best way would be to use parens within the parse block as a means to return if we should continue in this rule, (and maybe even based on type, how many items to skip!). |
hum... you are asking my mind to shift from cgi and web site writing to parse rule generation.. hehe I'm a bit deep in the construction of Revault right now... with about 10 files opened and mapped in my mind ;-) | |
Chris 2-Jun-2007 [8232] | Fair enough -- just curious... |
BrianH 2-Jun-2007 [8233x2] | What Maxim is describing is the CHECK clause proposal I made a few years ago. See here: http://www.colellachiara.com/soft/Misc/parse-rep.html |
This collection was made last year, but I first proposed CHECK years ago (calling it IF at the time), for the previous round of proposals. | |
Henrik 5-Jun-2007 [8235x2] | I'm working on reducing memory consumption on my little database and was wondering if stats is reading out the total memory usage correctly or if Windows XP's job list is. I can do a script that gradually eats up 100 MB memory and then the memory is recycled, when I ask for it. 'stats then prints about 15 MB used, which is fine, but the job list reads out about 100 MB still used and it stays there. Right now it reads about 104.656 KB used, while stats prints 15588191 bytes. This is in a stopped console. Recycling more doesn't help. I've even seen the job list memory jump up 10-20 MB once when recycling. Which one is reading out the correct number? |
I think I get it. If I run the script again, the job list does not show memory usage to be above 104 MB until stats also show above 104 MB. So Windows must be keeping inactive memory around for the task. | |
Chris 5-Jun-2007 [8237] | I've made a small change to the %filtered-import.r script -- it should now properly handle the 'opt modifier: >> import [][test: opt string!] == [test none] >> import [test ""][test: opt string!] == [test none] >> import [test ""][test: string!] == none This last one could be considered unexpected? |
Louis 6-Jun-2007 [8238x2] | I'm trying to learn how to make tcp servers, reading this rebol doc: file:///C:/SDK/docs/core23/rebolcore-13.html#section-14 Why am I getting this error: >> listen: open tcp://:8001 ** Access Error: Error opening socket listen port ** Near: listen: open tcp://:8001 Turning the firewall off does not help. |
This seems to work: >> listen: open tcp://localhost:8001 But the docs specifically say: Notice that you do not supply a host name, only a port number. This type of port is called a listen port. The system now accepts connections on port number 8001. Is this a mistake in the docs? | |
Sunanda 6-Jun-2007 [8240] | Henrik -- I think Gabriele said recently that REBOL *never* hands back memory to the opsys. So, although, REBOL's stats are reporting in-use memory, they are not telling you all the still reserved memory. I think that explains your observations. |
sqlab 6-Jun-2007 [8241x2] | Lous: your port is already opened either by an opther application or by this rebol instance as you can connect to. So either use an other port number or close your listen socket before opening again |
sorry Lous --> Louis | |
Henrik 6-Jun-2007 [8243] | sunanda, I see, thanks |
Will 6-Jun-2007 [8244x2] | anyone else thinks this would be useful? reduce 'abc/'def/(1 + 2) instead of to path! reduce ['abc 'def (1 + 2)] |
but you can't do abc/'def/(1 + 2) so maybe a new repath function: repath abc/'def/(1 + 2) ? | |
older newer | first last |