Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Evaluator of expressions with 'where clause

 [1/11] from: jan:skibinski:sympatico:ca at: 21-Oct-2002 18:03


Hi all, I have posted a new %eval.r script to the library. Excerpt from scipt documentation: The functional language Haskell, my (other :-)) prefered computer language provides two basic language structures for evaluation of expressions with local assignments: the 'let clause and the 'where clause. I am quite fond of the latter kind, since it let me work the way I like: starting with a main concept and deferring the details to the 'where clause. For example, this is a simple expression with the 'where clause: x * y + z where x = 12 * sin y y = 3 * z z = 7 ...... and in Rebol: eval [x * y + z] [ x: 12 * sin y y: 3 * z z: 7] .... I had to change the name from 'where to 'eval for readability. Rebol does not provide for user defined infix operations, does it? [No, 'eval is not exactly the same as the 'use function.] Jan

 [2/11] from: greggirwin:mindspring at: 21-Oct-2002 17:06


Wow! Thanks for posting that Jan. I'm not sure if, or where, I'll use it, but it's an impressive, and very clear, example. --Gregg

 [3/11] from: jan:skibinski:sympatico:ca at: 21-Oct-2002 20:02


Thanks Gregg for the good words. I play for a moment mainly with utilities because I am not ready for a big game yet :-). A question: Is there any documentation related to Rebol datatypes - aside from the stuff in the core user guide (I am using the pdf version, possibly outdated). Is there any bigger and precise picture on how those types are related and grouped in meta-types? Intuitively, most types seem to be obvious, but there are some obscure types, such as struct!, etc. What is a difference between 'any and 'any-type? I noticed that the help utility sometimes responds with the former and sometimes with the latter. Is there any special meaning in it, or is this a matter of an accidental ora historical nature? Does it have anything to do with a differentiation between the native! and the function!? Or explicit/implicit unknown argument types? I have my motivations to get it clarified, and I will describe some of them some time later. And one more question: Where does the differentiation between the actions and the functions come from? Implementation only? Thanks, Jan

 [4/11] from: tomc:darkwing:uoregon at: 21-Oct-2002 22:32


which libary? I do not find it on http://www.reboltech.com/library/script-all.html (or on rebol.org) On Mon, 21 Oct 2002, Jan Skibinski wrote:

 [5/11] from: al:bri:xtra at: 22-Oct-2002 19:41


Run Rebol/View, click on the Rebol.com folder, then the library folder. Click on the History icon (wait for a bit) then click on the file name eval.r to display the editor with the text of eval.r inside it. Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [6/11] from: tomc:darkwing:uoregon at: 21-Oct-2002 23:59


ahh yes reminds me of why I prefer the console
>> desktop
** Script Error: over is missing its of argument ** Where: wake-event ** Near: f/parent-face/feel/over f/parent-face a e
>>
On Tue, 22 Oct 2002, Andrew Martin wrote:

 [7/11] from: lmecir:mbox:vol:cz at: 22-Oct-2002 12:33


Hi Jan, ----- Original Message ----- From: "Jan Skibinski"
> A question: Is there any documentation related to Rebol > datatypes - aside from the stuff in the core user guide (I am > using the pdf version, possibly outdated). Is there any > bigger and precise picture on how those types are related > and grouped in meta-types?
http://www.rebolforces.com/~ladislav/mutable.r contains a list of all types and metatypes except for STRUCT!
> What is a difference between 'any and 'any-type?
See the above file
> I noticed that the help utility sometimes responds > with the former and sometimes with the latter. > Is there any special meaning in it, or is this > a matter of an accidental ora historical nature?
Historical and special.
> Does it have anything to do with a differentiation > between the native! and the function!?
No.
> Or explicit/implicit unknown argument types?
ANY is implicit argument type.
> And one more question: > Where does the differentiation between the actions and > the functions come from? Implementation only?
Implementation - NATIVE!, ACTION! and OP! might have as well been implemented as one datatype. -L

 [8/11] from: gscottjones:mchsi at: 22-Oct-2002 5:57


From: "Gregg Irwin" ...
> but it's an impressive, and very clear, example.
Union of REBOL and Haskell Raskel ;-) --Scott Jones

 [9/11] from: rotenca:telvia:it at: 22-Oct-2002 13:53


Hi Jan Skibinski
> What is a difference between 'any and 'any-type? > I noticed that the help utility sometimes responds
<<quoted lines omitted: 4>>
> between the native! and the function!? > Or explicit/implicit unknown argument types?
When a function is without explicit type, it is visualized by Help with 'any (it is only an help feature, cannot be used as specification for a function argument). 'Any-type! means: any argument, also unset! argument, no argument, error! argument. x2: func [a [any-type!]][value? 'a] x2 ;== false x2 print "" ;== false x2 make error! "" ;== true 'Any means: one argument, not unset! and error!. x: func [a][value? 'a] x; ** Script Error: x is missing its a argument ** Near: x x print "" ;** Script Error: x is missing its a argument ** Near: x print "" x make error! "" ;** User Error: ** Near: x make error! "" --- Ciao Romano

 [10/11] from: jan:skibinski:sympatico:ca at: 22-Oct-2002 10:16


Hi Ladislav and Romano, Thanks for your help. Jan

 [11/11] from: greggirwin::mindspring::com at: 22-Oct-2002 10:41


<< Raskel >> I like it! --Gregg

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted