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

World: r3wp

[!REBOL3-OLD1]

Henrik
13-Dec-2006
[1709]
APPLY function mentioned in the R3 blog.
Graham
13-Dec-2006
[1710]
where is that useful?
DideC
14-Dec-2006
[1711x2]
It's funny to see Native English people afraid of going in a country 
where English is not as known as in  ie. North european country :)

Be sure that native French people are afraid too to go in ie. US. 
Very very few people speak a second language there !!
But, he ! Paris is a touristic town !!

So don't be afraid, you will find a way to be understood by others.
And "arms" are universal language ;-)
Gregg
14-Dec-2006
[1713x2]
:-) Not only do very few of us speak a second language, but many 
of us have trouble with English. I always smile when I chat with 
people from around the world who apologize for their poor English 
when, in reality, it's often more correct than what American's write. 
It doesn't have the natural flow of a native speaker, but more advanced 
words are used, and used correctly. 


Knowing, now, how hard it was just to learn a few phrases in other 
languages for my dialect session, I have even more respect for all 
of you who give *entire* presentations in a non-native language.
Of course, I write that, and then see I've misused an apostrophe 
in there (American's). :-\
Maxim
14-Dec-2006
[1715]
hehe
Geomol
14-Dec-2006
[1716]
:-D

Gregg, you did a marvelous job with your multi-language intro at 
last DevCon. You tricked me for a second to think, you were fluent 
in all those languages. :-) I remember, I started to speak danish 
to you, and you raised your finger like saying: "I'm coming to that." 
hehe
Gregg
14-Dec-2006
[1717]
I'll have to add Danish if I ever do it again. :-) I couldn't have 
done it without a lot of help from the native speakers, particularly 
Richard. I wasn't even *close* on my Czech, working from translated 
text. At least he got a good laugh out of it. :-) Fortunately, nobody 
was there who could criticize my Indonesian.
[unknown: 9]
14-Dec-2006
[1718]
And 
arms" are universal language ;-)"

So is MONEY : )
Volker
14-Dec-2006
[1719]
Not without arms. You need to point out -  no,  at - what you want!
Rebolek
15-Dec-2006
[1720]
Actually most people have arms, that's not so true with money :)
sqlab
15-Dec-2006
[1721]
depends of the meaning of "arm",
arm like a limb or like a weapon.
Rebolek
15-Dec-2006
[1722]
yes, weapons are universal language too ;-)
Volker
15-Dec-2006
[1723]
but you need arms to hold them!
Robert
15-Dec-2006
[1724]
10/11 May? I'll be there.
BrianH
15-Dec-2006
[1725]
And the vocabulary of weapons is a little limited.
Maxim
15-Dec-2006
[1726]
ready, aim, fire
   
that pretty much covers the dialect
Henrik
15-Dec-2006
[1727]
and reload?
sqlab
18-Dec-2006
[1728]
and lock and unlock.)
Henrik
20-Dec-2006
[1729]
Ladislav, it wasn't until you wrote those two small examples, that 
I finally understood what APPLY is about. :-)
CharlesS
20-Dec-2006
[1730]
what examples
Henrik
20-Dec-2006
[1731]
charles, see the R3 blog on the APPLY function at the bottom of comments
CharlesS
20-Dec-2006
[1732x2]
What advantages does HASH have over regular blocks, I can access 
a regular block like a dictionary anyway
right ?
Henrik
20-Dec-2006
[1734]
it's very fast
Maxim
20-Dec-2006
[1735x2]
speed.... MUCH faster on lookup
IIRC slower on insert
Henrik
20-Dec-2006
[1737x3]
I think the normal procedure is to manipulate your block like you 
normally would and then convert it to hash! when you want to do lookups
I posted something on the APPLY thing on empty argument blocks, which 
I think should produce an error. This made me think of whether there 
is a very easy way to tell how many arguments a function requires?
ah, first :+ == [value1 value ]
JaimeVargas
20-Dec-2006
[1740x2]
variable arg dispatching breaks a major premise of rebol dispatch 
mechanism.
Henrick. In scheme/lisp. 

apply :+ [] ;== 0

whichs is a very sensible result.
Henrik
20-Dec-2006
[1742]
well, is it then not necessary to set up different rules for what 
it should output for different functions?
JaimeVargas
20-Dec-2006
[1743x2]
I am not sure what you mean. Another example is: 

apply :* [] ;== 1
Scheme gives out this results because 0 and 1 are *neutral* numbers 
regarding addition and multiplaction. That is the result is unaltered 
by those values respectevely.
Henrik
20-Dec-2006
[1745]
these are arithmetic operations. what about other kinds?
JaimeVargas
20-Dec-2006
[1746]
Rebol functions can't accept a variable number of arguments with 
the exception of refinements. So the issue is becomes important. 
APPLY is kind of incompatible to the principle that * every  function 
has a fixed number of arguments*.
Izkata
20-Dec-2006
[1747]
They can if you take advantage of the unset! datatype...  But it's 
not pretty and more confusing than it's worth
Henrik
20-Dec-2006
[1748]
I just think it would be more straight forward with natives for performing 
arithmetics on blocks. It's more predictable.
Maxim
20-Dec-2006
[1749]
predictable?
Henrik
20-Dec-2006
[1750]
apply :* [] ;== 1 isn't predictable within REBOL terms, I think
JaimeVargas
20-Dec-2006
[1751x2]
APPLY just means run this function with the block content as args. 
So:


APPLY :+ [1 2 3 4]  is equivalent to DO [+ 1 2 3 4]  ;; using scheme 
semantics
If we stick with this definition an no varargs for functions then 
APPLY :+ [1 2 3 4] is impossible it actually should throw an error 
because the native '+ requires two arguments.
Maxim
20-Dec-2006
[1753]
yes Jaime that is how I see it in REBOL too... so in rebol the last 
two args would be ignored if we use the current understanding
JaimeVargas
20-Dec-2006
[1754]
In which case APPLY with math ops is kind of lame compared to scheme.
Maxim
20-Dec-2006
[1755x2]
how does scheme understand to continue grabbing values?  because 
its not hitting an action?
or because it servers args within an argument () ?
JaimeVargas
20-Dec-2006
[1757x2]
I APPLY was simply implemented as the DO translation; you will get 
tons of side effects. Because,


APPLY :+ [1 2 3 4] implented as DO [+ 1 2 3 4] ;== 4 (NOT 10 wich 
is the expected result).
Because in Scheme you can have function with variable number of arguments 
thanks to the parenthetical notation. (APPLY + '(1 2 3 4)) ;== (+ 
1 2 3 4)  and '+ is coded to handle variable arguments.