SICP Exercises in F#, Exercise 1.4

> let a_plus_abs_b a b =
 let add a b = a + b
 let sub a b = a - b
 if b > 0 then
  add a b
 else
  sub a b;;

val a_plus_abs_b : int -> int -> int

> a_plus_abs_b 1 -4;;
val it : int = 5
Advertisements

0 Responses to “SICP Exercises in F#, Exercise 1.4”



  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





%d bloggers like this: