Changeset 38201 in project


Ignore:
Timestamp:
02/25/20 16:52:16 (5 weeks ago)
Author:
juergen
Message:

pseudolists with pl-maker added

Location:
release/5/pseudolists
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • release/5/pseudolists/tags/1.4/pseudolists.egg

    r37770 r38201  
    55 (test-dependencies simple-tests)
    66 (author "Juergen Lorenz")
    7  (version "1.3")
     7 (version "1.4")
    88 (components (extension pseudolists)))
    99
  • release/5/pseudolists/tags/1.4/pseudolists.scm

    r37770 r38201  
    3333
    3434(module pseudolists
    35   (pl-iterate pl? pl-of?
     35  (pl-maker pl-iterate pl? pl-of?
    3636   pl-null? pl-length pl-head pl-sentinel
    3737   pl-flatten pl-reverse
     
    5050          (only (chicken base) cut case-lambda assert print error))
    5151
     52
     53(define (pl-maker sentinel . args)
     54  (let recur ((args args))
     55    (if (null? args)
     56      sentinel
     57      (cons (car args) (recur (cdr args))))))
    5258
    5359(define pl-iterate
  • release/5/pseudolists/tags/1.4/tests/run.scm

    r37770 r38201  
    33        pseudolists
    44        simple-tests)
     5
     6;(define pl (pl-maker #f 0 1 2))
    57
    68(define-test (pseudolists?)
     
    1012  ((pl-of?) "x")
    1113  ((pl-of? symbol?) '(a b . c))
     14
     15  (equal? (pl-maker #f 0 1 2) '(0 1 2 . #f))
     16  (not (pl-maker #f))
    1217
    1318  (equal? (pl-iterate add1 5 0) '(0 1 2 3 4))
  • release/5/pseudolists/trunk/pseudolists.egg

    r37770 r38201  
    55 (test-dependencies simple-tests)
    66 (author "Juergen Lorenz")
    7  (version "1.3")
     7 (version "1.4")
    88 (components (extension pseudolists)))
    99
  • release/5/pseudolists/trunk/pseudolists.scm

    r37770 r38201  
    3333
    3434(module pseudolists
    35   (pl-iterate pl? pl-of?
     35  (pl-maker pl-iterate pl? pl-of?
    3636   pl-null? pl-length pl-head pl-sentinel
    3737   pl-flatten pl-reverse
     
    5050          (only (chicken base) cut case-lambda assert print error))
    5151
     52
     53(define (pl-maker sentinel . args)
     54  (let recur ((args args))
     55    (if (null? args)
     56      sentinel
     57      (cons (car args) (recur (cdr args))))))
    5258
    5359(define pl-iterate
  • release/5/pseudolists/trunk/tests/run.scm

    r37770 r38201  
    33        pseudolists
    44        simple-tests)
     5
     6;(define pl (pl-maker #f 0 1 2))
    57
    68(define-test (pseudolists?)
     
    1012  ((pl-of?) "x")
    1113  ((pl-of? symbol?) '(a b . c))
     14
     15  (equal? (pl-maker #f 0 1 2) '(0 1 2 . #f))
     16  (not (pl-maker #f))
    1217
    1318  (equal? (pl-iterate add1 5 0) '(0 1 2 3 4))
Note: See TracChangeset for help on using the changeset viewer.