elspify

browserify transform to compile eslisp

Usage no npm install needed!

<script type="module">
  import elspify from 'https://cdn.skypack.dev/elspify';
</script>

README

elspify Travis-CI Status

browserify transform for eslisp

Installation

Install package with npm and add it to your development dependencies:

npm install --save-dev elspify

Usage

  • index.esl:
; Only include given statement if `$DEBUG` environment variable is set
(macro debug
 (lambda (statement)
  (return (?: (. process env DEBUG)
              statement
              null))))

(var fib ; Fibonacci number sequence
   (lambda (x)
    (debug ((. console log) (+ "resolving number " x)))
    (switch x
     (0 (return 0))
     (1 (return 1))
     (default (return (+ (fib (- x 1)) (fib (- x 2))))))))

Then pass the transform when compiling your app:

$ browserify -t elspify index.esl > index.js

License

MIT