Sha256: aa22d3a4fea5afc1e124bbaf8a9262b2358d3bfa08bb164aaa2edc15bcb9be16

Contents?: true

Size: 954 Bytes

Versions: 5

Compression:

Stored size: 954 Bytes

Contents

(examples-for list/grep
  ("it finds strings"
   (list/grep
    string?
    (list 'foo "bar" '(a b "c d" e) { ignores "hash elements" }))
   ("bar" "c d"))

  ("it finds items whose car is carryon"
   (list/grep
    λf(caris 'carryon f)
    '(foo
      (carryon 1 2 3 42)
      (bar (40 41 42 (carryon 43 (carryon 42) 41)))
      42
      99))
   ((carryon 1 2 3 42)
    (carryon 43 (carryon 42) 41)
    (carryon 42)))

  ("it finds items of length 3"
   (list/grep
    λf(eq? 3 (len f))
    '(foo
      (2 3 42)
      (bar (40 41 42) (43 (x y z) 41))
      42
      99))
   ((2 3 42)
    (bar (40 41 42) (43 (x y z) 41))
    (40 41 42)
    (43 (x y z) 41)
    (x y z)))

  ("it finds code within interpolated strings"
   (list/seek-cars 'include (parse-in-string "
<div>~~(include \"empty-name.html\")</div>
<div>~~(map λn(let name n (include \"show-name.html\")) {names})'</div>
"))
   ((include "empty-name.html")
    (include "show-name.html"))))

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nydp-0.6.0 lib/lisp/tests/list-grep-examples.nydp
nydp-0.5.1 lib/lisp/tests/list-grep-examples.nydp
nydp-0.5.0 lib/lisp/tests/list-grep-examples.nydp
nydp-0.4.6 lib/lisp/tests/list-grep-examples.nydp
nydp-0.4.5 lib/lisp/tests/list-grep-examples.nydp