-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
Description
In the student languages, function predicate allows one to define a
type (signature form) constrained by a predicate that indicates
precisely the values that belong to the type.
(define (nonzero-number? v) (and (number? v) (not (= v 0))))
(define NonZeroNumber (signature (predicate nonzero-number?)))Even though predicate is defined in all student languages, it cannot
really be used in BSL or BSL+ where functions are not first class.
I'm unsure what's the best way of handling this. Removing predicate
from BSL is not a good idea, given that there are several examples of
data type definitions that are already used with BSL and BSL+ (e.g.,
interval data types in HtDP) but would require predicate to be
defined.
Would making functions first class already in BSL and BSL+ create any
issues?
Reactions are currently unavailable