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

World: r3wp

[Rebol School] Rebol School

Anton
27-Feb-2009
[2496x2]
Test it:
>> son: context [parent: self]
>> son/parent = son
== true
You could do:

	mother: context [
		son: context compose [parent: (self)]
	]

so now

	>> mother/son/parent = mother
	== true
Graham
27-Feb-2009
[2498]
better idea :)
Anton
27-Feb-2009
[2499]
Oldes did some work with unicode, if I remember correctly.
kib2
27-Feb-2009
[2500]
Anton: hi! thanks a lot: what's the meaning of the parenthesis here 
?
Anton
27-Feb-2009
[2501x4]
The COMPOSE rebuilds the block, with anything in parens evaluated 
first.
So SELF will be evaluated before the second CONTEXT has a chance 
to see it.
But, if you're curious, you can always have a look yourself, using 
PROBE, eg:

	mother: context [son: context compose probe [parent: (self)]]

	mother: context [son: context probe compose [parent: (self)]]
mother: context [son: context probe compose [parent: (self)]]

etc..
kib2
27-Feb-2009
[2505x2]
ah...funny : nice example.
For the encoding, I was asking this because all my accented chars 
in HTML appear correctly but one, the "à".
Anton
27-Feb-2009
[2507x2]
Just move the probe from right to left to find out what's happening.
kib2, check rebol.org. I just did some quick searching.
http://www.rebol.org/view-script.r?script=utf8-encode.r
http://www.rebol.org/view-script.r?script=utf-8.r
kib2
27-Feb-2009
[2509]
Anton: thanks, exactly what I was looking for :)
kib2
2-Mar-2009
[2510]
Is it possible to draw something (lines, arrows, curves, etc) on 
top of buttons in a GUI app ?
Geomol
2-Mar-2009
[2511]
view layout [button 200 "Button with graphics" effect [draw [line 
0x0 10x20 40x0 60x20]]]
kib2
2-Mar-2009
[2512]
Geomol: sorry, I should have said "on top of several buttons". 

See http://farm4.static.flickr.com/3664/3323050539_dbd72b61e8_o.png
where I want to draw lines between numbers.
Geomol
2-Mar-2009
[2513]
view layout [origin 0 space 0 button 50x50 "1" button 50x50 "2" at 
0x0 box 50x100 effect [draw [line 0x0 30x20 0x60 40x100]]]
kib2
2-Mar-2009
[2514]
Extra: thank you!
Henrik
2-Mar-2009
[2515]
will events pass through the box?
kib2
2-Mar-2009
[2516]
Henrik: I think so, why ?
Geomol
2-Mar-2009
[2517]
:-) heh, prob. not. But I bet, kib can figure that out.

Don't you wanna interact the buttons with the mouse?
kib2
2-Mar-2009
[2518]
Geomol: yes with the mouse; in fact if you click on a number, i should 
draw all possible bridges (lines) coming from it.
Geomol
2-Mar-2009
[2519x2]
When you have the box with the lines on top over all the buttons, 
you can't press them directly.
Your mouse button press will 'hit' the box with graphics.
kib2
2-Mar-2009
[2521]
Ok, thanks for the hints : I think I have to study VID events a little 
more than what I've already done.
PatrickP61
2-Mar-2009
[2522]
I have a question on same?  Do the following:
a: "apple"
b: to-string 'apple
same? a b
== false


Why is that, they are both strings of the same length and datatype, 
just not created in the same way?
kib2
2-Mar-2009
[2523]
Good question : i really don't know. Moreover, a == b returns true.
PatrickP61
2-Mar-2009
[2524x2]
I tried this too:
a: "apple"
b: "apple
same? a b
== false


Does same? mean that it is the same object, not that the contents 
are the same?
I found the answer,  It is ONLY if the two are the same object
kib2
2-Mar-2009
[2526]
I know that = compares values, == compares values and types. Same? 
is native, and the docs says "Returns TRUE if the values are identical".
Henrik
2-Mar-2009
[2527x2]
same? means litterally the very same string.
same? is useful for identifying references.
kib2
2-Mar-2009
[2529]
Henrik: do you mean their location (via a pointer) ?
Henrik
2-Mar-2009
[2530x3]
yes
it's not entirely like pointers, but BrianH can explain that much 
better than me.
>> a: "boo"            
== "boo"
>> b: reduce [a copy a]
== ["boo" "boo"]
>> same? b/1 a
== true
>> same? b/2 a
== false
kib2
2-Mar-2009
[2533]
ok, it's clearer now. But how do you explain this ?
a: "apple"
b: to-string a
same? a b ; --> returns false


Does that mean that to-string makes just a copy of a, and so does 
not point to the same location ?
PatrickP61
2-Mar-2009
[2534]
This link seems a little confusing to me  http://www.rebol.com/r3/docs/functions/same-q.html

At first, it seems like it is comparing the values of two objects, 
but if you read further, it says they must reference the same objectS
Henrik
2-Mar-2009
[2535x2]
kib2: yes. to get the desired effect, use AS-STRING instead of TO-STRING. 
That is an R2 only feature though.
Patrick, yes, I agree, it should be written more clearly.
kib2
2-Mar-2009
[2537]
understood, thanks.
Henrik
2-Mar-2009
[2538x2]
hmm. it also exists in R3. I remember there was talk about it having 
problems when used with Unicode, but I may be wrong.
AS-STRING is useful to represent a binary as a string. There is a 
similar AS-BINARY function for converting strings to binaries.
Gregg
3-Mar-2009
[2540]
Also, most code doesn't need to use SAME?. I use it very rarely. 
If you're writing frameworks, or GUI stuff where you want to track 
references it's important. Other than that, simple value comparisons 
are all you need.
kib2
4-Mar-2009
[2541]
Hi, is there any REBOL version running on a PocketPC 2002 version 
?
amacleod
4-Mar-2009
[2542x2]
Depends onhte processor I think but I got core running on an old 
pocketPC
onhte = on the
kib2
4-Mar-2009
[2544]
nice, thanks
BrianH
4-Mar-2009
[2545]
Core 2.5.0.15.5 for WinCE 2.0 Handheld PC works on PocketPC 2002, 
but is not onscreen-keyboard aware - the onscreen keyboard obscures 
the command line, so you better have a builtin or bluetooth keyboard, 
or perfect typing. As with all R2 WinCE releases, there is no support 
for the clipboard, program command line, file associations, or background 
operation. This makes it almost unusable, even on a machine with 
a hardware keyboard.


I was the one who requested the build, and there hasn't been a WinCE 
build since.