[plt-scheme] The perfect teaching language--Is this too much to ask for?
That's an implementation. State a specification instead.
[Hint: I actually did describe an implementation of an "equivalent"
specification in my previous message. The burden is on you to show
why it's not "equivalent".]
Shriram
On Sat, Jun 13, 2009 at 6:45 PM, Luciano Ramalho<ramalho at gmail.com> wrote:
> On Sat, Jun 13, 2009 at 7:00 PM, Shriram Krishnamurthi<sk at cs.brown.edu> wrote:
>>> 2. Types in the Language
>>
>> These are not types. These are simply inspectors on the run-time
>> tags. Your own example illustrates the point:
>>
>>>>>> type(isinstance)
>>> <type 'builtin_function_or_method'>
>>
>> The *type* of isinstance would be something like
>>
>> isinstance :: value x type -> boolean
>>
>> [Never mind that type should not be a type.] In contrast, the
>> run-time tag is "some kind of applicable object", and that's what
>> Python gives you.
>
> Python builtins are an exception, but usually what you get from type()
> is much more than a description: you get the actual class object:
>
>>>> l = [1, 2, 3]
>>>> type(l)
> <type 'list'>
>>>> my_type = type(l)
>>>> l2 = my_type()
>>>> l2
> []
>>>> type(l2)
> <type 'list'>
>>>>
>
> Is there a Scheme equivalent of this interaction? How is it?
>
> Cheers,
>
> Luciano
>