Changeset 36750 in project


Ignore:
Timestamp:
11/02/18 13:17:43 (13 days ago)
Author:
juergen
Message:

simple-cells 1.1 now accepts zero or many predicates in cell-of?

Location:
release/5/simple-cells
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/5/simple-cells/tags/1.1/simple-cells.egg

    r36312 r36750  
    66 (dependencies simple-exceptions)
    77 (author "Juergen Lorenz")
    8  (version "1.0")
     8 (version "1.1")
    99 (components (extension simple-cells)))
  • release/5/simple-cells/tags/1.1/simple-cells.scm

    r36312 r36750  
    8484               result?))))))
    8585
    86 ;;; ((cell-of? ok?) xpr)
    87 ;;; --------------------
    88 ;;; evaluates xpr to a cell passing the ok? check?
    89 (define ((cell-of? ok?) xpr)
     86;;; ((cell-of? ok? ...) xpr)
     87;;; ------------------------
     88;;; evaluates xpr to a cell passing the ok? ... checks?
     89(define ((cell-of? . predicates) xpr)
    9090  (and (cell? xpr)
    91        (ok? (xpr))))
     91       (let loop ((preds predicates))
     92         (cond
     93           ((null? preds) #t)
     94           (((car preds) (xpr))
     95            (loop (cdr preds)))
     96           (else #f)))))
    9297
    9398;;; (simple-cells sym ..)
     
    116121    (cell-of?
    117122      procedure:
    118       (cell-of? ok?)
     123      (cell-of? . predicates)
    119124      "returns a predicate, which checks, if its argument"
    120       "is passed by the ok? check")
     125      "is passed by any predicate of the predicates list")
    121126    )))
    122127    (case-lambda
     
    132137
    133138) ; module simple-cells
    134 
  • release/5/simple-cells/tags/1.1/tests/run.scm

    r36312 r36750  
    99  (cell? o%)
    1010  ((cell-of? number?) o%)
    11   (not ((cell-of? even?) o%))
     11  (not ((cell-of? number? even?) o%))
    1212  (not (condition-case (o% 4) ((exn argument) #f)))
    1313  (= (o%) 5)
  • release/5/simple-cells/trunk/simple-cells.egg

    r36312 r36750  
    66 (dependencies simple-exceptions)
    77 (author "Juergen Lorenz")
    8  (version "1.0")
     8 (version "1.1")
    99 (components (extension simple-cells)))
  • release/5/simple-cells/trunk/simple-cells.scm

    r36312 r36750  
    8484               result?))))))
    8585
    86 ;;; ((cell-of? ok?) xpr)
    87 ;;; --------------------
    88 ;;; evaluates xpr to a cell passing the ok? check?
    89 (define ((cell-of? ok?) xpr)
     86;;; ((cell-of? ok? ...) xpr)
     87;;; ------------------------
     88;;; evaluates xpr to a cell passing the ok? ... checks?
     89(define ((cell-of? . predicates) xpr)
    9090  (and (cell? xpr)
    91        (ok? (xpr))))
     91       (let loop ((preds predicates))
     92         (cond
     93           ((null? preds) #t)
     94           (((car preds) (xpr))
     95            (loop (cdr preds)))
     96           (else #f)))))
    9297
    9398;;; (simple-cells sym ..)
     
    116121    (cell-of?
    117122      procedure:
    118       (cell-of? ok?)
     123      (cell-of? . predicates)
    119124      "returns a predicate, which checks, if its argument"
    120       "is passed by the ok? check")
     125      "is passed by any predicate of the predicates list")
    121126    )))
    122127    (case-lambda
     
    132137
    133138) ; module simple-cells
    134 
  • release/5/simple-cells/trunk/tests/run.scm

    r36312 r36750  
    99  (cell? o%)
    1010  ((cell-of? number?) o%)
    11   (not ((cell-of? even?) o%))
     11  (not ((cell-of? number? even?) o%))
    1212  (not (condition-case (o% 4) ((exn argument) #f)))
    1313  (= (o%) 5)
Note: See TracChangeset for help on using the changeset viewer.