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

World: r3wp

[Core] Discuss core issues

Maxim
17-Oct-2009
[14831x2]
false == (some magic trick) first load "[any]"
true == (same magic trick) first append [] in system/words 'any


the first is just an unbound word, using the string just makes this 
explicit beyond doubt.
the second is the actual word func. added to a block.
or are all words bound to the global context by default, making this 
impossible... as I think.
Steeve
17-Oct-2009
[14833]
you mea, you want to construct a block with ANY unbound to a context 
?
Maxim
17-Oct-2009
[14834]
maybe I can just do this :

same? bound? first load "[any]" system/words 

 and assume I'm not actually using global words in my blocks...
Steeve
17-Oct-2009
[14835x2]
>> value? first to-block "any"
== false
in that exemple, ANY is not bound
Maxim
17-Oct-2009
[14837]
let me check something... it might add to the confusion  :-)
Steeve
17-Oct-2009
[14838x2]
to-block, do like LOAD, except it doesn't bound the words in the 
global context
>> do probe to-block "1 + 1"
[1 + 1]
** Script Error: + word has no context
** Near: 1 + 1
Maxim
17-Oct-2009
[14840x2]
>> value? first to-block "[any {a}]"
== true
this is whacky
Steeve
17-Oct-2009
[14842x2]
lol
>> value? first to-block "any {a}"
== false
Maxim
17-Oct-2009
[14844]
I know... very broken.
Steeve
17-Oct-2009
[14845]
No,  you must remove the brackets
Maxim
17-Oct-2009
[14846x2]
but my data HAS inner blocks.
this is just plain dumb.
Pekr
17-Oct-2009
[14848]
the result is of course correct ..
Steeve
17-Oct-2009
[14849]
So, do a double first

>> value? first first to-block "[any {a}]"
== false
Pekr
17-Oct-2009
[14850]
and? 'any is a word. It surely does not have a value. What are you 
wondering about?
Maxim
17-Oct-2009
[14851x2]
pekr it aint. if to-block doesn't bind words... it just shouldn't 
.  how am I going to manage loading data from disk and hope it doesn't 
collide with some stray global word
but I realize that all words are bound.
Steeve
17-Oct-2009
[14853]
Actually, to-block doesn't bound anything, what the problem so ?
Maxim
17-Oct-2009
[14854]
ok, let me try something then.
Steeve
17-Oct-2009
[14855]
In the old past days, 
to-block "[any]" was returning only one block.

It's returning a double block since some versions, never understood 
the interest of such change.
>> to-block "[any]"
== [[any]]
Maxim
17-Oct-2009
[14856x2]
ok, so parse is the root of my problem.  it specifically word binding 
for its keywords, but looks up all other words... which is what's 
causing the inconsistency in my code.
specifically *ignores* word
Steeve
17-Oct-2009
[14858]
I don't see your point, what you say seems wrong, can you give us 
an example ?
Maxim
17-Oct-2009
[14859x2]
in my code, I was getting different results for some keywords.  any 
is bound to global, but some isn't anything in rebol.
so since I can't create my rules using to-block (cause the parse 
rule is actully changing itself, using pre-bound rules... I'm stuck.
Steeve
17-Oct-2009
[14861x2]
well, just bind yout rules in a specific context.
con: context [
	any: 'any
	some: 'some
	opt: 'op
	...
]
redefines the parse keywords as you want
Maxim
17-Oct-2009
[14863x2]
so what I'll do is follow parse's functioning.  if a word maps to 
a function or a native, ignore it... I know my rules don't bind functions, 
cause they'd fail anyways.
yeah that would work too.
BrianH
17-Oct-2009
[14865]
Maxim, BOUND? doesn't bind words to the global context - that was 
done by LOAD. Try this:
>> bound? first to-block "a"
== none
Maxim
17-Oct-2009
[14866]
yes yes... that was understood later on.
BrianH
17-Oct-2009
[14867]
I'm trying to hack up an UNBIND backport to R2/Forward though.
Maxim
17-Oct-2009
[14868]
load is the core culprit here.  I didn't realize that all my rules 
where being bound at application load time, since every word is created 
by load initially.
BrianH
17-Oct-2009
[14869]
That was one of the first things changed in R3. If need be you write 
your own loader for R2 that uses TO-BLOCK and then does the binding 
itself - LOAD in R3 is a mezzanine that does the same.
Graham
23-Oct-2009
[14870x3]
>> d: now/time
== 17:11:08
>> d/1
== 17
>> d/2
== 11
>> d/3
== 8.0
>> d/3: 0
== 0
>> d
== 17:11
>> d: now
== 23-Oct-2009/17:11:37+13:00
>> d/4
== 17:11:37
>> d/4/3
== 37.0
>> d/4/3: 0
== 0
>> d
== 23-Oct-2009/17:11:37+13:00
>> t: d/time
== 17:11:37
>> t/3: 0
== 0
>> d/time: t
== 17:11
>> d
== 23-Oct-2009/17:11+13:00
I can change the second component of a time! but now when it is part 
of date!    ???
but not ...
Maxim
23-Oct-2009
[14873x3]
date doesn't have accessors for individual time values...
once you use d/time, its a new value of type time!
you have to use d/time: t  in order to push it back into the date.
Graham
23-Oct-2009
[14876]
inconsistent
Maxim
23-Oct-2009
[14877]
I would have tought R3 would have addressed this, but it hasn't  
:-(

... I just checked
Graham
23-Oct-2009
[14878x3]
>> date: now
== 23-Oct-2009/19:31:27+13:00
>> type? date/time
== time!
>> date/time/3
== 27.0
>> date/time/3: 0
== 0
>> date
== 23-Oct-2009/19:31:27+13:00
What exactly is the explanation here??
I'm accessing a time value .. not a date value