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

World: r3wp

[Core] Discuss core issues

Steeve
21-Dec-2008
[11828]
i used the first alpha release
[unknown: 5]
21-Dec-2008
[11829]
I'll yield to those that have used the Alpha a bit more as I really 
couldn't speculate at this point even.
Anton
21-Dec-2008
[11830x2]
Steeve, it does look odd, like a bug.
These are ok.
>> same? o do bind [self] o
== true
>> same? o do bind [self] in o 'b
== true
[unknown: 5]
21-Dec-2008
[11832]
If you think it is a bug Anton, then you should report it to Rambo 
assuming your talking about R2.
Anton
21-Dec-2008
[11833]
I leave this honour to Steeve. :)
Steeve
21-Dec-2008
[11834]
boring...
Anton
21-Dec-2008
[11835]
There are no tickets that match a search for "bind?" in Rambo.
Steeve
21-Dec-2008
[11836]
so you are the one who will fill the hole ;-)
Anton
21-Dec-2008
[11837]
Aha! I like your style of humour! :)
Steeve
21-Dec-2008
[11838]
especialy when we know that the word humour has a greek root  meaning 
FLUID
Gabriele
22-Dec-2008
[11839x2]
Steeve, o and the result of bind? are the same context but not the 
same object. this is an implementation detail of R2.
I do not think this is a bug, and it may not be trivial to fix it 
if it was (which means, it'll never get fixed as Carl is not going 
to spend that much time on R2 for something not important)
Steeve
22-Dec-2008
[11841]
i agree Gab, for me, it's not a bug but a functionnality
Anton
22-Dec-2008
[11842]
What use does it have ?
Steeve
22-Dec-2008
[11843x5]
none for the moment... ;-)
i
in R3 it would be usefull combined with the ability to expand an 
object
it would be something like an inheritance link
a dynamic one
[unknown: 5]
22-Dec-2008
[11848]
Sure it does - it allows Gabriele's function to work.
Steeve
22-Dec-2008
[11849]
don't think it's related
Steeve
23-Dec-2008
[11850x3]
Gabriele's func would work without this
be
besides in R3, the bind? func doen't return a cloned object anymore
Gabriele
23-Dec-2008
[11853]
Anton, it's not that it has any use, it's that there is no "object" 
internally, just a "context", and the bind? function creates an "object" 
for the "context" so that it can return it (there is no way to access 
a context directly). bind? does not know whether the context is already 
referenced by an existing object or not, nor has any way to get to 
any such existing objects, so it just always creates a new one.
Anton
23-Dec-2008
[11854]
Ahh that makes sense. So yes, an implementation detail of R2.
Geomol
23-Dec-2008
[11855x2]
Has anyone noticed a max length for filenames giving to EXISTS? under 
Windows? I get a false reply, if the length of the full path is more 
than some 54 characters.
Ah, my bad. It works! I had my dir in another place. doh! ;-)
Geomol
25-Dec-2008
[11857]
When using local blocks in functions, that is called many times, 
I often define them as:

my-block: clear []

instead of

my-block: copy []


The idea is to reuse the block (the memory area), so the garbage 
collection has less to do. Could there be any drawback in this?
Henrik
25-Dec-2008
[11858]
I do the same thing, so I would be interested in hearing about draw 
backs. But it may also be important to specify the size of the block, 
when it's first created. That gives the garbage collector even less 
to do.
[unknown: 5]
25-Dec-2008
[11859x8]
Yeah, you don't want to do that.  Because with each loop that evaluates 
the command you actually recreating the pointer.  Instead do this:

my-block: []
...
clear my-block
This way your doing less evaluation.
However, it allows you to be more flexible and possibly save some 
evaluation depending on how you implement it.
Let me give some examples.
Example 1
>> stats/evals/clear
== [1 1 1]
>> my-block: []
== []
>> loop 100 [insert my-block "somedata" clear my-block]
== []
>> stats/evals
== [506 202 103]

Example 2
>> stats/evals/clear
== [507 203 104]
>> loop 100 [my-block: clear [] insert my-block "somedata"]
== []
>> stats/evals
== [604 202 102]

Example 3
>> stats/evals/clear
== [605 203 103]
>>
>> loop 100 [insert my-block: clear [] "somedata"]
== []
>> stats/evals
== [504 202 102]
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
[11877]
that works