John
In the "EFP" book a small circle is used for composition with an
explanation that this is written as a lower case o in ML (not a dot).
Also the definition in the book is not as you have written it. It
should be:
fun f1 (x,y,z) = (x,y,1)
fun f2 (x,y,z) = (x,y,z * x)
fun f3 (x, y,z) = (x + 1, y, z)
val body = f3 o f2
Chris Reade
On 8 Jul 2007, at 06:43, John Terrence wrote:
> In <et9rnc$6op$1@[EMAIL PROTECTED]
> Chris Reade wrote:
>> I have some old workshop material containing exercises online (for
>> beginners and no longer maintained) at
>> http://www.kingston.ac.uk/~ku07009/MLWorkshop/start.html
>>
>> Chris Reade
>> On 8 Mar 2007, at 02:46, Maloo wrote:
>
> Hi Chris Reade !
>
> Sorry to hijack a thread like this, but asked a question about your
> book
> "EFP" in another thread.
>
> fun f1 (x,y,z) = (x,y,1) fun f2 (x,y,z) = (x,y,z * x) fun f3 (x +
> 1, y,
> z) = (x + 1, y, z)
> val body = f3.f2
>
>
> goes crazy on SML-NJ:
>
> Standard ML of New Jersey v110.60 [built: Sun Nov 12 17:21:48 2006]
> - [
> opening /tmp/sml18216PQH]
> /tmp/sml18216PQH:5.5-5.37 Error: non-
> constructor applied to argument in pattern: +
> /tmp/sml18216PQH:5.25
> Error: unbound variable or constructor: x
> /tmp/sml18216PQH:6.12-6.17
> Error: unbound structure: f3 in path f3.f2
> uncaught exception Error
>
> raised at: ../compiler/TopLevel/interact/evalloop.sml:63.48-63.56
> ../
> compiler/TopLevel/interact/evalloop.sml:44.55
> ../compiler/
> TopLevel/interact/evalloop.sml:291.17-291.20
> - f2; stdIn:1.1-1.3 Error:
> unbound variable or constructor: f2
> - f1; stdIn:1.1-1.3 Error: unbound
> variable or constructor: f1
> - body; stdIn:1.1-1.5 Error: unbound
> variable or constructor: body
> -
>
> I'm using sml-mode.
> Can you help?
> Thanks in advance.
>
> JT.
>
>
>
> This email has been scanned for all viruses by the MessageLabs Email
> Security System.
This email has been scanned for all viruses by the MessageLabs Email
Security System.


|