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

World: r3wp

[Rebol School] Rebol School

Gregg
4-Mar-2009
[2558]
Nice Christophe! Someone should tell Carl to link to it from REBOL.com.
kib2
4-Mar-2009
[2559x2]
I took the contents from a REBOL tutorial I've found "REBOL Essentials". 
Now, I think it could be better, ie there's nothing on arguments.
Got my present today : http://www.flickr.com/photos/kib2/3328900688/
:)
Henrik
4-Mar-2009
[2561]
posted the link to kib2's cheatsheet in Chat/R3/Docs. we'll see if 
Carl likes it.
kib2
4-Mar-2009
[2562]
Thanks Henrik, feel free to give any feedbacks or critics.
Henrik
5-Mar-2009
[2563]
kib2, Carl wants to publish the URL through his blog, with your permission. 
He likes it very much.
Pekr
5-Mar-2009
[2564]
Henrik - isn't kib's sheet similar to how R2 function dictionary 
was structured? I suggested Carl to sub-structure R3 function reference 
too ....
kib2
5-Mar-2009
[2565x2]
Henrik: Hi. Really ? Ok, no problem.
I've updated the page and the cheatsheet: http://kib2.free.fr/REBOL/papers/cheatsheet.html
. You'll also find the original ods file.
Henrik
5-Mar-2009
[2567]
kib2, you could also color code them, for example by native and mezzanine.
kib2
5-Mar-2009
[2568]
Henrik: good idea. How can I know easily wich ones are mezzanines 
?
Henrik
5-Mar-2009
[2569x2]
? native! is a good one.
pekr, yes it's similar.
kib2
5-Mar-2009
[2571x2]
Sorry, I should have said "among all those words", I don't want to 
type them one by one !
oops, sorry I didn't look at the output
Henrik
5-Mar-2009
[2573]
since you have created the sheet manually (if I'm correct), I would 
create a block with the words in the sheet in the order as shown 
on the sheet and then do something like:

foreach word words [
	print [word type? get word]
]
kib2
5-Mar-2009
[2574]
Yes, that's a better way I think
Henrik
5-Mar-2009
[2575x2]
that simplifies things a bit
for R3 there will also be information about whether the function 
modifies the input. that would be useful as well.
kib2
5-Mar-2009
[2577]
hum... I've made some rules in my OO calc sheet to set some styles 
(ie color a line on two), and if I had native/mezzanines it will 
break all.
I've to find an issue.: maybe add a column for that.
Henrik
5-Mar-2009
[2578]
Actually there are also action! types, which are related to natives.

Perhaps one-letter identification in a separate column:

N = Native, A = Action, F = Function, M = Modifies Input, etc.
kib2
5-Mar-2009
[2579]
Ok, great suggestions !
Henrik
5-Mar-2009
[2580]
it's probably a good idea to keep separate sheets for R2 and R3, 
since some functions have moved from mezzanine to native and vice 
versa in R3.
Geomol
5-Mar-2009
[2581x2]
I'm wondering, if it's important for a newbie to the language to 
distinguish between natives, actions and functions. Wouldn't it just 
confure more?
Even as an experienced REBOL programmer, I seldom look at those things. 
It's only in cases, where I need utterly performance, or if I wanna 
see, what some function does.
kib2
5-Mar-2009
[2583]
CheatSheet Updated to v1.2 .

Geomol: that makes sense to me, but sure that may be confusing. But 
it's not a problem on this sheet, just don't take the second column 
into account.
Geomol
5-Mar-2009
[2584x2]
Looks good! :-)
Maybe (follow) should be (continued)? What does the english-speaking 
here say?
Brock
5-Mar-2009
[2586]
Can the two Series blocks not be combined into one list on the right 
side of the page?
kib2
5-Mar-2009
[2587x3]
Brock: yes, I already had that in mind. Next release :)
Brock : done!
Is it possible to draw something inside an over function  (in a GUI 
app) ?
Geomol
5-Mar-2009
[2590x5]
If I understand you correct, then I do that in Canvas RPaint, so 
yes. Have you tried that paint program?
view layout [box 400x400 effect [draw [line]] feel [engage: func 
[f a e] [if a = 'over [append f/effect/draw e/offset show f]]]]

Try paint with the mouse.
Ups, was that a one-line paint program? ;-P
*Ops*
There's a lot of REBOL One-liners here, you might find amusing:
http://www.rebol.com/oneliners.html
kib2
5-Mar-2009
[2595x2]
Geomol: thanks, that will be a lot more complicated for my case.
that does not work...even the print message does not appear. An idea 
?

monlayout: [
    origin 0x0 space 0x0 across
    ; --- define a new button (style)
    style p image %vide.png 
    style node image %but.png 
    effect [draw [line]] feel [ 
        engage: func [f a e /local x y island] [
            if a = 'over [
                print "over"
                x: round/down e/x / 40 + 1
                y: round/down e/y / 40 + 1
                island: game/:x/:y
                if island/ways <> none [
                    foreach v island/ways [

                        append f/effect/draw to-pair [x y] to-pair [v/x v/y] show f
                    ]
                ]
            ]
        ]
    ]
]
Geomol
5-Mar-2009
[2597]
The effect isn't attached to a style. You have style definitions, 
and then effect.
kib2
5-Mar-2009
[2598]
it isn't attached to the node style ?
Geomol
5-Mar-2009
[2599x3]
yes, but it's just a definition. Where is your buttons? :-)
Put extra p and node at the bottom of your momlayout.
*monlayout*
kib2
5-Mar-2009
[2602]
that changes nothing.
My buutons are appened at runtime like this :

out: copy []
foreach line hashi [
    foreach letter line [ 
        either (letter = "")
            [repend out ['p letter] ]
            [repend out ['node letter]] 
    ]
    repend out ['return]
]

then ... monlayout def  

then ...
 
append monlayout out
Geomol
5-Mar-2009
[2603]
Do you layout monlayout after this?
kib2
5-Mar-2009
[2604]
Yes, like this :
view center-face layout monlayout
Geomol
5-Mar-2009
[2605x2]
This works here:


myl: [style node image logo.gif effect [draw [line]] feel [engage: 
func [f a e] [if a = 'over [append f/effect/draw e/offset show f]]]]
append myl [node "my node"]
view layout myl
You have a simple bug somewhere, I guess. :-)
kib2
5-Mar-2009
[2607]
hum...the problem is actualy to know where !