[plt-scheme] Re: Poacher turned gamekeeper

From: wooks (wookiz at hotmail.com)
Date: Thu Nov 12 08:38:12 EST 2009


On Nov 12, 1:01 pm, Nadeem Abdul Hamid <nad... at acm.org> wrote:
> You could try asking a student to be the function -- tell them you'll  
> give them a sequence of digits (or write them on the board) and they  
> have to read back to you the number. Try it with some 3 and 4 digit  
> numbers; then give them something like  "13z5". Hopefully, they'll say  
> something like "that's not a number"; Try with a couple more valid  
> sequences of digits; then another invalid one. Point out to them, that  
> when they are given something not a number, then they are deciding  
> somehow what a suitable response is -- "false" is just an easy,  
> abbreviated way of indicating the "not a number" case -- because it  
> wouldn't make sense to read back some arbitrary number if given  
> something like "13z5." I don't think you want to overkill this issue  
> at this point -- just make it seem intuitively sensible and move on.

Hmmm. This will come right after the example of string-append that
crashes when given a numeric argument.....

I guess it's an early exposure to the need to look up a fucnctions
contract specification - sometimes you can intuit and sometimes you
need to look it up.


Posted on the users mailing list.