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

World: r3wp

[Core] Discuss core issues

Volker
11-Feb-2007
[7100x3]
in-shadow-context: use first system/words['some-word]

then bind to 'some-word. somewhat  expensive, but you do it only 
on input. 

Escapes: it  does not go into #[object![..]]. I have  a function 
which does  that too.  ifthe user can do a  stringwith a new word, 
that  word is still global.
and  then fill your functions in.
use first system/words reduce[f1: (:f1) ... 'some-word]
no,  compose.
Ladislav
11-Feb-2007
[7103]
UNBIND might help handling such constructs, maybe
Volker
11-Feb-2007
[7104x2]
It would. do we have it?
I hope in  r3
Ladislav
11-Feb-2007
[7106]
yes, it has been offered for R3 in a blog
Graham
11-Feb-2007
[7107]
Yes, I want to bind it to a different context to be safe .. so exactly 
how do I create this different context for all the math stuff?
Gabriele
11-Feb-2007
[7108x2]
>> a: context compose [
[    (to set-word! '+) get in system/words '+
[    ]
>> a/+

** Script Error: + expected value1 argument of type: number pair 
char money date time tuple
** Near: a/+
(don't ask me why +: is not a valid set-word)
Ladislav
11-Feb-2007
[7110x2]
another option:


math-words: [+ - * / ** = == =? < <= > >= and or xor square-root 
negate]
math-words: use math-words reduce [math-words]
foreach word math-words [set word get in system word]
etc.
the last line should have been:

    foreach word math-words [set word get in system/words word]
Volker
11-Feb-2007
[7112]
yes. but keep in mind bind ignores functions and objects, so you 
must  recurse into them too.
Maxim
11-Feb-2007
[7113x6]
can anyone confirm that these two statements should return the same 
value for the same blk and val?

select blk val
second find blk val


as long as val does exist in blk.
does select reduce both args before selecting?
my god... REBOL is going nuts!  I have a situation where the above 
is not true...  and the select pairs are [aword an-object bword another-object]
and only the find works... if I try to select using 'aword   it always 
returns none
print first reduce blk

raises an error as expected since aword is not defined anywhere!
help! this is tooo strange!
Anton
11-Feb-2007
[7119x2]
relax... rebol is probably not going nuts. There is a reason somewhere.
quickly make a little example file which demonstrates the problem 
using a new console.
Maxim
11-Feb-2007
[7121x3]
hehe... its just that no probing or printing reveals anything out 
of the expected.
using a new console, things behave as expected... which is why I 
am wondering why they don't in the running code
(using a block with simple values, the two lines above act as I would 
expect)
Anton
11-Feb-2007
[7124]
Ok, then fork the entire code and cut away chunks until it no longer 
displays the problem.
Maxim
11-Feb-2007
[7125x2]
ehh impossible... we are talking bout an entire app here... 200-300kb 
of code. probably... and the problem occurs within an event loop.
but look at the simplicity of the two lines above... can you image 
a way in  which  the select would return none and the find would 
return the object?
Anton
11-Feb-2007
[7127x2]
(not impossible - that technique works when I can think of nothing 
else).
A confusion between lit-words and words maybe ?
Maxim
11-Feb-2007
[7129x2]
hum...
unfortunatetely, I can't print the block, cause the objects have 
nested objects, and that causes an out of memory err, If I try to 
mold it  :-(
Anton
11-Feb-2007
[7131x2]
write clipboard:// mold/all blk
and paste it (and mold/all VAL) into a new editor window.
Ah..
Maxim
11-Feb-2007
[7133]
the actual app takes very little ram, but the objects, have bidirectional 
linking... so I guess the mold never reaches the end.
Anton
11-Feb-2007
[7134]
Ok, then, for your test, before molding, process each object to set 
none all fields which could recurse.
Maxim
11-Feb-2007
[7135x4]
hum... I'll try my inspector... maybe it can help me a bit...
oops... closed altme by mistake... the inspector basically has the 
same problem...
I'm trying some block alterations...
wrt lit-word vs word... find is reacting as expected.... select is 
numb like a frog on ice
Anton
11-Feb-2007
[7139]
Maybe check that BLK really has the expected types in the correct 
order.
Maxim
11-Feb-2007
[7140x6]
oh my... I just found it... 

 same?  :select get in system/words 'select
== false
seems some code redefines select somewhere...   >:-(
well, thanks for bearing with me... your words vs lit-words  idea... 
got me probing differently..
strangely, I can't trace where that is happeneing... willl try to 
protect the word...
well, as usually protect doesn't help... arrgh.
(as usuall)
Anton
11-Feb-2007
[7146]
protect doesn't help ? Is SELECT redefined despite being protected 
?
Maxim
11-Feb-2007
[7147x3]
well, protect, only helps within the global context... which is why 
I wish there was /HARD mode which protected ANY setup of a specific 
word.
probably also can protect word within a context... but at that point, 
the damage is usually done.
I've discoverd another way to discover where a set occurs... within 
objects, you look at the first... and the natural order of words, 
is a telling clue...