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

World: r3wp

[Rebol School] Rebol School

Steeve
8-Feb-2009
[1783x2]
sub suuuuuuuuuuuuuuuub ;-)
like in rebcode
Geomol
8-Feb-2009
[1785x4]
Most operators have prefix only twins (that are called actions). 
Like: equals? is the twin of =
equal?
(without s)
multiply, add, subtract, divide, remainder, lesser?, lesser-or-equal?, 
not-equal?, equal?, strict-equal?, same?, greater?, greater-or-equal?
kib2
8-Feb-2009
[1789]
Geomol: power
Steeve
8-Feb-2009
[1790]
beware with same? it's not really a math operator
Geomol
8-Feb-2009
[1791x4]
If you prefer SUB instead of SUBTRACT, just do this in the beginning:

sub: :subtract
ah yes, POWER aslo.
*also*
I think, SAME? is like =?
Steeve
8-Feb-2009
[1795x2]
yes but it's used for serie manipu
or objects, not for maths
Geomol
8-Feb-2009
[1797]
>> [a b c] = [a b c]
== true
>> [a b c] == [a b c]
== true
>> [a b c] =? [a b c]
== false
Steeve
8-Feb-2009
[1798]
oh my.... you should not bother Kib with same? too early ;-)
Geomol
8-Feb-2009
[1799x4]
lol, he's bright, so he get it.
>> 1 = 1.0  
== true
>> 1 == 1.0
== false
Remember, if you wanna know more about operators like =, == and =?, 
just use ? to ask about them:

>> ? =?
It's fun doing these REBOL School sessions. It helps refresh the 
memories of us more experienced coders. It's hard (impossible) to 
remember all the corners of REBOL.
kib2
8-Feb-2009
[1803x2]
Geomol: in the last case 1 and 1.0 are different beasts because the 
first is integer and not the other, that's it ?
Can we use complex numbers ?
Geomol
8-Feb-2009
[1805]
REBOL is like a little magical mountain lake. It doesn't look much 
on the surface, but it's soo deep.
Steeve
8-Feb-2009
[1806]
yes Kib2 but the doc is incomplete, == is also case sensitive
>>"a" = "A"
==true
>>"a" == "A"
==false
Geomol
8-Feb-2009
[1807x2]
kib, yes. == wants both to be same value and same datatype.
kib, you can implement complex numbers as two numbers inside a block.
Steeve
8-Feb-2009
[1809]
or should i say, = is not case sensitive
Geomol
8-Feb-2009
[1810]
kib, I've made a little library for complex numbers, if you like.
kib2
8-Feb-2009
[1811]
Geomol: I don't need them for starting, but maybe I'll have to use 
them later on. Where is it located ?
Geomol
8-Feb-2009
[1812]
http://www.fys.ku.dk/~niclasen/rebol/libs/math/complex.r

Just a little start, and no documentation, so you have to read the 
code to figure it out.
Steeve
8-Feb-2009
[1813]
is there something in Rebol.org also ?
kib2
8-Feb-2009
[1814x2]
Geomol: thanks, no problem for the doc. Reading your code is the 
same.
Geomol: are you the author of the postscript dialect ?
Geomol
8-Feb-2009
[1816]
yes
kib2
8-Feb-2009
[1817x2]
whao...
So i have a difficult question : how do you handle intersection(s) 
between two paths ?
Anton
8-Feb-2009
[1819x2]
kib2: Note well.  
	either 0 [true][false]  ;== true
	either 1 [true][false]  ;== true
hence:
	either (modulo malong 2) [true][false]  ; == true, always...
Geomol
8-Feb-2009
[1821]
kib, :-D
Do you expect me to remember, how postscript works. ;-)
I have to think a bit now ...
Steeve
8-Feb-2009
[1822]
ahah
Geomol
8-Feb-2009
[1823]
kib, I think, I remember the concept of paths in postscript. Can 
you give an example of such an intersection?
Steeve
8-Feb-2009
[1824]
you're like me Geomol, after some months, my memory is garbage collected
Geomol
8-Feb-2009
[1825x2]
LOL yes
I try to remember the really important things, the rest just hit 
the bin.
Anton
8-Feb-2009
[1827x2]
kib2: you can write:
	either (1 = modulo malong 2) [true][false]
In rebol, 0 is equivalent to true, not to false (as in many other 
languages).
Steeve
8-Feb-2009
[1829x2]
Geomol if your memory works like mine, you only remember process 
and structures not contents
you remember abstract shapes, not data
Geomol
8-Feb-2009
[1831x2]
well, I also remember data. I try to remember the important data.
like the greek alphabet. Doh! ;-)