SICP Exercises in F#, Exercises 1.1

> 10;;
val it : int = 10
> 5 + 3 + 4;;
val it : int = 12
> 9 - 1;;
val it : int = 8
> 6 / 2;;
val it : int = 3
> (2 * 4) + (4 - 6);;
val it : int = 6
> let a = 3;;

val a : int

> let b = a + 1;;

val b : int

> b;;
val it : int = 4
> a + b + (a * b);;
val it : int = 19
> (a = b);;
val it : bool = false
> if (b > a) && (b  if (a = 4) then 6
elif (b = 4) then (6 + 7 + a)
else 25;;
val it : int = 16
> 2 + (if b > a then b else a);;
val it : int = 6
> if (a > b) then a
elif (a  (if (a > b) then a
elif (a < b) then b
else -1) * (a + 1);;
val it : int = 16
Advertisements

0 Responses to “SICP Exercises in F#, Exercises 1.1”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s