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

World: r3wp

[Core] Discuss core issues

JaimeVargas
13-Sep-2005
[1965]
Yes, we can patch rebol and fixed ourselves, but we should remove 
some "surprises" like making CONSTRUCT safe.
Gregg
13-Sep-2005
[1966]
It's really a question of default behaviors, right? (making sure 
we're talking about the same thing)  My concern is that, by making 
more things "safe" at the native level, we may create more issues 
than we solve.
JaimeVargas
13-Sep-2005
[1967x2]
I had another issue with the behaviour of APPEND which is different 
for block! hash! than from list! and it is a side effect of INSERT 
and REMOVE
APPEND b: make block! [] [v1 v2] head? b ;== true
APPEND l: make list! [] [v1 v2] head? l ;== false
I don't know how many of this type of examples are there, but is 
quite annoying to debug these side effects.
Gabriele
13-Sep-2005
[1969]
that has nothing to do with append - that has to do with list!s.
Gregg
13-Sep-2005
[1970]
I would say that's a bug in APPEND, because of the way the doc-string 
is worded.
Gabriele
13-Sep-2005
[1971x2]
l: append ... would work
but append l ... does NOT change the word 'l
Ladislav
13-Sep-2005
[1973]
actually, it isn't a bug and it is almost impossible to change, but 
it may need a documentation
JaimeVargas
13-Sep-2005
[1974]
We need more consistency. I discuss the APPEND issue extensively 
with Ladislav, and it is about docs and side effects. What I fear 
is the explosing of exceptions.
Gabriele
13-Sep-2005
[1975]
could be changed, but only for the "head" case, if the list head 
was a special node (like Exec's double linked lists)
JaimeVargas
13-Sep-2005
[1976x2]
I would like also to be able to implement our own types! and be able 
to overload some words. So that an implementation of associative 
arrays can work look like [make aa! 10] instead of [aa/make 10]
Any opposition on proposing the change to CONSTRUCT?
Gregg
13-Sep-2005
[1978]
Do you mean CONTEXT?
JaimeVargas
13-Sep-2005
[1979]
Sorry CONTEXT.
Gregg
13-Sep-2005
[1980]
You can propose it. I'm happy to let Carl decide. I wonder if it 
might cause some confusion as it won't be an exact replacement for 
make object!, which it's just a shortcut for. It could break code 
and change behavior if substituted.
Ladislav
13-Sep-2005
[1981]
I am quite curious if it breaks really would break some code
Graham
13-Sep-2005
[1982]
Jaime, can you list these issues in the gotchas in the wikibook so 
that they can be documented for all.
BrianH
13-Sep-2005
[1983]
I would probably stop using CONTEXT with this change.


I may not be a newbie, but I don't see how this behavior is different 
from the way blocks that aren't explicitly copied are shared throughout 
REBOL. Once you learn this gotcha once (like, the first time you 
make a function with a local block), you have learned it throughout. 
There are always workarounds, and the default behavior can be extremely 
useful if you are expecting it.
Ladislav
13-Sep-2005
[1984x3]
I am speaking about the following example:
objects: []
loop 2 [
	append objects make object! [a: 1 block: [a]]
]
objects/2/a: 2
do objects/1/block ; == 2 !
are you sure you can never be caught?
BrianH
13-Sep-2005
[1987]
I usually do that kind of thing like this:

objects: []
loop 2 [
	append objects make object! [a: 1 block: does [a]]
]
objects/2/a: 2
objects/1/block ; == 1 !
Volker
13-Sep-2005
[1988]
To me thats the typical copy-problem. i use 'copy in context-blocks 
too.
   make object! [a: 1 block: copy[a]]
In most cases it does not matter, as 'func copies too.
But when it goes wrong, its pretty confusing.
BrianH
13-Sep-2005
[1989]
The only time it can get tricky is when sharing parse rules. The 
way I work around that is to encapsulate them in a shared object, 
but occassionally it can cause a problem (simultaneous parsing) that 
only copying can help with.
Ladislav
14-Sep-2005
[1990]
BrianH: nevertheless, you didn't tell me, when would the changed 
CONTEXT cause you any trouble and what kind of trouble?
Graham
14-Sep-2005
[1991]
Now that we have open/seek, is there some way to compute a check 
sum on a large file by reading it in part by part ?
BrianH
15-Sep-2005
[1992]
Ladislav, I frequently use shared data in non-copied data structures 
that are referenced by many objects. This data isn't always in blocks 
- frequently I use hashes, lists or objects. These would be copied 
by your CONTEXT changes too, when my code expects them to stay the 
same. Lists and hashes are not affected by your rebinding problem 
- only blocks, parens and functions are rebound during object creation, 
because only they directly contain code under normal circumstances.


In the past I've found it easier to change the code that treats blocks 
as shared code ckunks into functions, or to make helper functions 
that create and initialize objects appropriately.
Rebolek
15-Sep-2005
[1993x7]
Hm this is strange
>> none and true
** Script Error: Cannot use and~ on none! value
** Near: none and true
Looks like 'and is calling 'and~
So perform some simple tests.
>> x: now/time/precise loop 10000000 [true and true] probe now/time/precise 
- x
0:00:03.39
>> x: now/time/precise loop 10000000 [and~ true true] probe now/time/precise 
- x
0:00:05.188
Hm, 'and is calling 'and~ but is faster than 'and~
Ladislav
15-Sep-2005
[2000x3]
BrianH: do you think, that you could give a simple example using 
MAKE OBJECT! that would break using the deep copying variant of CONTEXT?
Even better, if you have got such an example already in your scripts
TIA
Joe
15-Sep-2005
[2003]
I found that that running core on a AMD 64-bit box is not better 
than in a 3-year older 32-bit box. Should we expect a 64-bit core 
build ?
Graham
15-Sep-2005
[2004]
Not any time soon.
Pekr
15-Sep-2005
[2005]
how do you know? :-)
Graham
15-Sep-2005
[2006]
logic!
Pekr
15-Sep-2005
[2007]
>> true? logic!
== false :-)
Graham
15-Sep-2005
[2008]
RT has already stated their priorities viz OSX, SDK, and then IOS. 
 Since Rebol presumably runs already on windows 64 bit version, there 
is no pressing need to develop that product, and so it is logical 
to assume that it falls in priority after all of the above.
Pekr
15-Sep-2005
[2009]
well, no news on OS-X for how long? One month? Things really go way 
too much slowly .....
Graham
15-Sep-2005
[2010]
However, since Carl released the Genesi PPC Linux version  just recently, 
I guess it also true to assume Carl does not act logically !
Pekr
15-Sep-2005
[2011x2]
:-))
well, it is surely easier to port Core than to port View ... that 
might be the reason?
Graham
15-Sep-2005
[2013x2]
Do you mean, do the easy things first and leave the hard stuff to 
later?
If so, I don't think that's a recipe for success.