[racket] htdp/2e: on types and popular scripting languages
The 'A or B' on the left side of the arrow isn't really a defined set of values. It's an English suggestion that it's either from one set (A) or the other (B). When the book presents signatures and explains their meanings, it says not to use anything but defined names -- and here it breaks this rule, so a comment is in order. -- Matthias
On Jan 22, 2015, at 11:37 AM, Daniel Bastos wrote:
> Near exercise 305, HtDP/2e says that "[in] ISL+ (... and in the currently popular scripting languages) such an informal signature with a definite meaning is acceptable on occasion; do not use it too often, however."
>
> It refers to this definition.
>
> ; [List-of Attribute] or [List-of Xexpr.v2] -> Boolean
> ; is the given value a list of attributes?
> (define (list-of-attributes? x)
> (cond
> [(empty? x) #true]
> [else (local ((define possible-attribute (first x)))
> (cons? possible-attribute))]))
>
> Why "acceptable on occasion"? I don't get the message. What is it saying? Thank you.
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users