Changeset 31332 in project


Ignore:
Timestamp:
09/05/14 11:29:43 (5 years ago)
Author:
juergen
Message:

version 0.1 of options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/options

    r31328 r31332  
    6565type predicate.
    6666
    67 ==== some?
    68 <procedure>(some? xpr)</procedure>
    69 evaluates xpr to a nonempty option?
     67==== none?
     68<procedure>(none? xpr)</procedure>
     69evaluates xpr to an empty option?
    7070
    71 ==== some-value
    72 <procedure>(some-value opt)</procedure>
     71==== some-ref
     72<procedure>(some-ref opt)</procedure>
    7373fetches the value out of the option argument, it there is one,
    7474otherwise signals an error.
     
    8181(define opt (some 5))
    8282(option? opt) ; -> #t
    83 (some? opt) ; -> #t
    84 (some? (none)) ; -> #f
    85 (some-value opt) ; -> 5
     83(none? opt) ; -> #f
     84(none? (none)) ; -> #t
     85(some-ref opt) ; -> 5
    8686(option? (none)) ; -> #t
    87 (some-value (none)) ; -> error
     87(some-ref (none)) ; -> error
    8888</enscript>
    8989
Note: See TracChangeset for help on using the changeset viewer.