untitled.gif welcome towards my cool internet house site: re: dear prof tobot (zoom)

[ back | refresh | last 25 | post new ]

welcome to my cool internet home sit is prosecÇ–tedt to a jam

VALID X M L
Hair Cares Product!!!!!
re: dear prof tobot
[29721] by "TOBOT NANOnymous" (h-68-165-24-61.phlapafg.dynamic.covad.net)   on Tue 09 Dec 2003 20:20:24     reply ] [ up ]
fun makelist 0 = []
|makelist 1 = []
|makelist 2 = [2]
|makelist x = x::[makelist (x-1)];

max close but: type of (makelist n) is int list? rite?  so if u say [makelist (x-1)] then u have int list list? so how can u put x on top of that?

also y do u need cases for 0 and 1 ? will they ever b reached?

----------

2nd there is no reson 2 write ur thing 4 a whole list: there is a function List.exists that will tell u if some func evaluate 'true' for any elem in a list. 4 example

fun isthree x =   x = 3

List.exists isthree [1, 2, 3, 4, 5, 6]

that is true bacaeuse isthree on 3 is true !!!!

but

List.exists isthree [1, 2, 4, 5, 6]

 that one is false !!!

can u use this to help ur program b easier???