0.3.0 ā€¢ Published 7 years ago

eslisp-propertify v0.3.0

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

eslisp-propertify npm.io npm.io npm.io

An eslisp macro that rewrites its input forms' atoms that contain dots into property accesses. This means you can write x.y.1 instead of (. x y 1), which compiles to JS as x.y[1];.

Ignores trailing and leading dots, and atoms that consist of dots.

Example

(macro propertify (require "/path/to/elisp-propertify/index.js"))
(propertify (a.b 42))

ā†“

a.b(42);

See the tests for fuller usage.

Full wrap

It's totally reasonable to wrap your whole program in this. Consider the eslisp compiler's --transform flag.

Limitations

If you need a computed member expression, you'll still need the . macro: For example, to get a.b[b.length], you'll need to write (. a.b b.length).

License

ISC.

0.3.0

7 years ago

0.2.1

8 years ago

0.2.0

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago