Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ml > Re: SML please ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 927 of 973
Post > Topic >>

Re: SML please for translation

by dbenson@[EMAIL PROTECTED] Oct 1, 2007 at 07:45 PM

On Sep 26, 1:00 pm, stainboy <jakub.p...@[EMAIL PROTECTED]
> wrote:
....
>
> type var = string;
> datatype exp =
>                   N     of int
>                 | V     of var;
>
> type value = int;
> type state = var -> value;
>
> fun expSem
>                 (N i)(s) = i
>       | expSem (V v)(s:state) = s v;
>
> what mean: (N i)(s) = i
> also:
> (V v)(s:state) = s v;
>
 First, lets clean up a little:

fun expSem (N i)(s) = i
  | expSem (V v)(s:state) = s v;

so the full expression to be evaluated is

expSem (N i)(s)

for the N datatype constructor and

expSem (V v)(s:state)

for the V datatype constructor.
 




 4 Posts in Topic:
SML please for translation
stainboy <jakub.pola@[  2007-09-26 20:00:56 
Re: SML please for translation
dbenson@[EMAIL PROTECTED]  2007-10-01 19:45:39 
Re: SML please for translation
Chris Rathman <Chris.R  2007-10-01 19:45:02 
Re: SML please for translation
Ivan Jager <aij+nospam  2007-10-15 23:03:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 20:10:09 CDT 2008.