[plt-scheme] Re: Poacher turned gamekeeper

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Thu Nov 12 08:01:49 EST 2009

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.

On Nov 12, 2009, at 6:42 AM, wooks wrote:

> On Nov 12, 11:32 am, "Geoffrey S. Knauth" <ge... at knauth.org> wrote:
>> On Nov 12, 2009, at 05:44, wooks wrote:
>>> On Nov 9, 2:50 pm, Matthias Felleisen <matth... at ccs.neu.edu> wrote:
>>>> 1. Use HtDP/2e to get started. Then switch.
>>> So I'm looking at it and wondering how to explain why (string- 
>>> >number
>>> "hello world") returns a boolean.
>> My documentation for beginner language says:
>> string->number : (string -> (union number false))
>> Purpose: to convert a string into a number, produce false if  
>> >impossible
> Yes I saw that. I was hoping be able to give a different answer than
> "thats the way it was defined".
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.