Sha256: 7d9310653230de28c65dec14cd998d94cf048c8fc367def060e0cc8822fd551f

Contents?: true

Size: 649 Bytes

Versions: 17

Compression:

Stored size: 649 Bytes

Contents

(examples-for push
  ("push a value onto the beginning of a list"
   (let x nil
     (push 'c x)
     (push 'b x)
     (push 'a x)
     x)
   (a b c))

  ("push a value onto the beginning of a list stored in a hash"
   (let x {}
     (push 'c x.stuff)
     (push 'b x.stuff)
     (push 'a x.stuff)
     (list (hash-keys x) x.stuff))
   ((stuff) (a b c)))

  ("push a value onto the beginning of a list using a hash-get expression"
   (let x {}
     (push 1 (hash-get x 'foo))
     (push 2 (hash-get x 'foo))
     (push 3 (hash-get x nil))
     (push 4 (hash-get x nil))
     (list (hash-keys x) x.foo (hash-get x nil)))
   ((foo nil) (2 1) (4 3))))

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
nydp-0.6.0 lib/lisp/tests/push-examples.nydp
nydp-0.5.1 lib/lisp/tests/push-examples.nydp
nydp-0.5.0 lib/lisp/tests/push-examples.nydp
nydp-0.4.6 lib/lisp/tests/push-examples.nydp
nydp-0.4.5 lib/lisp/tests/push-examples.nydp
nydp-0.4.3 lib/lisp/tests/push-examples.nydp
nydp-0.4.2 lib/lisp/tests/push-examples.nydp
nydp-0.4.1 lib/lisp/tests/push-examples.nydp
nydp-0.4.0 lib/lisp/tests/push-examples.nydp
nydp-0.3.0 lib/lisp/tests/push-examples.nydp
nydp-0.2.6 lib/lisp/tests/push-examples.nydp
nydp-0.2.5 lib/lisp/tests/push-examples.nydp
nydp-0.2.3 lib/lisp/tests/push-examples.nydp
nydp-0.2.2 lib/lisp/tests/push-examples.nydp
nydp-0.2.1 lib/lisp/tests/push-examples.nydp
nydp-0.2.0 lib/lisp/tests/push-examples.nydp
nydp-0.1.15 lib/lisp/tests/push-examples.nydp