World: r3wp
[Core] Discuss core issues
older newer | first last |
[unknown: 5] 25-Dec-2008 [11864x3] | Notice that example1 is more efficient than example 2. However, Example 3 takes the flexibility of setting my-block to a cleared block and actually is more efficient than example 1. |
So unless your gonna utilize that method as in Example 3 then your better off with Example 1. | |
Am I missing something or should this function be like an operator or something?: family?: func [arg1 arg2][ if equal? type? arg1 type? arg2 [return true] false ] Maybe convert >< into op! that performs that task. Maybe there is another function I overlooked. | |
PeterWood 26-Dec-2008 [11867] | I'm running a CGI script from which I want to 'launch another script to do some housekeeping. The output from the launched script (including the Rebol banners) is returned to the browser. Is there a way to redirect the output from the launched Rebol session? (I am getting this behaviour on both Mac OS X and Linux). |
eFishAnt 26-Dec-2008 [11868] | OK, so 'close does not return anything...so you can't try a block with close if close is the last line in the block of you check if error? try [close whatever] If I use instead: if error? catch [ close whatever true ][print "will this ever get printed?"] |
[unknown: 5] 26-Dec-2008 [11869] | I'm finding a bug in loop function. Anyone know of a problem with loop. Heading to Rambo... |
Steeve 26-Dec-2008 [11870] | enough... family?: func [arg1 arg2][ equal? type? arg1 type? arg2 ] |
[unknown: 5] 26-Dec-2008 [11871x3] | Yes Steeve, I was doing other things with ihe function which is why it had the false. That was a remant. |
Notice this problem I'm seeing in loop: >> d: [] == [] >> loop 2 [append d [1 [fname]]] == [1 [fname] 1 [fname]] >> db/get test5 d >> d == [1 [0] 1 [0]] >> d: [] == [] >> append d [1 [fname] 1 [fname]] == [1 [fname] 1 [fname]] >> db/get test5 d >> d == [1 [1] 1 [1]] | |
I spent a couple hours checking my code and yet it seems LOOP is the culprit. | |
Steeve 26-Dec-2008 [11874] | would be surprising... |
[unknown: 5] 26-Dec-2008 [11875] | I don't get it either it is really strange. |
Steeve 26-Dec-2008 [11876] | try... loop 2 [append d copy/deep [1 [fname]]] |
[unknown: 5] 26-Dec-2008 [11877x4] | that works |
>> loop 2 [append d copy/deep [1 [fname]]] == [1 [fname] 1 [fname]] >> db/get test5 d >> d == [1 [1] 1 [1]] | |
But the crazy thing is that the block contained the correct values without the copy/deep. | |
Still seems to be a bug somewhere. | |
Steeve 26-Dec-2008 [11881] | missing a copy somewhere in your code |
[unknown: 5] 26-Dec-2008 [11882x2] | I added copies and it didn't change anything so I removed them again. |
Besides it works find it I didn't use the loop to populate the block. | |
Steeve 26-Dec-2008 [11884] | do u use poke or change block! somewhere ? |
[unknown: 5] 26-Dec-2008 [11885x2] | yes I use change |
tried copy on that part also and it didnt' make a difference. | |
Steeve 26-Dec-2008 [11887] | hmm... |
[unknown: 5] 26-Dec-2008 [11888x2] | See this works fine: >> d: [] == [] >> insert tail d [1 [fname]] == [] >> insert tail d [1 [fname]] == [] >> d == [1 [fname] 1 [fname]] >> db/get test5 d >> d == [1 [1] 1 [1]] |
It is when I get the 0's in the part that I know it failed somewhere. I get that only when using loop to fill the d block. | |
Steeve 26-Dec-2008 [11890x2] | normal, it's different blocks, walways the same bug with a missing copy some |
...somewhere | |
[unknown: 5] 26-Dec-2008 [11892x3] | I copied it to death until I figured out it was in loop. |
Maybe not a bug just a need to use copy/deep in loop. | |
Steeve, I see what you were saying. I went ahead and fixed that by changing a piece of code so that the d block wasn't modified also. | |
BrianH 26-Dec-2008 [11895x2] | It's not a bg in loop, you are reusing the inner block [fname] where you shouldn't. |
>> d: [] == [] >> loop 2 [append d [1 [fname]]] == [1 [fname] 1 [fname]] >> same? second d fourth d == true | |
[unknown: 5] 26-Dec-2008 [11897] | Yeah we already determined that. Thanks Brian. |
BrianH 26-Dec-2008 [11898] | Cool :) I couldn't tell based on the messages above. |
[unknown: 5] 26-Dec-2008 [11899] | Yeah Steeve keyed in on the problem. |
Davide 29-Dec-2008 [11900] | Is there a way to modify an object (adding and removing components) at runtime without rebuild it from scratch ? I remember an old thread in the mailing list abut this argument, but I cannot find it.. |
Steeve 29-Dec-2008 [11901x3] | not it's impossible in R2 but doable in R3 |
in R3 do: append my-object new-var | |
wrong, in R3: append my-object [new-var: none] | |
Davide 29-Dec-2008 [11904] | R3 is going to be my nightmare :-) |
Steeve 29-Dec-2008 [11905] | when i need to simulate extendable objects in R2, i use blocks in replacement. |
Davide 29-Dec-2008 [11906] | I'm trying to find a workaroud using first object , second object ... but it doesn't seems to work |
Steeve 29-Dec-2008 [11907] | it can't |
Davide 29-Dec-2008 [11908x2] | I'm writing a function that replace every set-word in a block of code with a compoment of an object, so I have to build the object in one single pass |
(so every words become local for default) | |
Steeve 29-Dec-2008 [11910] | are there inner blocks which contain set-words too or not ? |
Davide 29-Dec-2008 [11911] | yes there are |
Steeve 29-Dec-2008 [11912x2] | so you can't use the construct function on the primary bock... |
except if the local vars are all set in the primary one too | |
older newer | first last |