New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslisp-fancy-function

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslisp-fancy-function

eslisp function macro with rest arguments and implicit return

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslisp-fancy-function

An eslisp macro that works like an the usual lambda expression macro but also

  • parses splats (atoms starting with ...) in the arguments and turns them into appropriate variable assignments prepended to the function body, and
  • implicitly returns the last thing in the body if it's an expression.

Note that despite the name, this module is strictly a function expressions (lambda-ish) macro, not a function declaration. I'll rearrange that eventually.

Example

(macro fun (require "eslisp-fancy-function"))
(fun (a b ...c d) (* a b d))

(function (a, b) {
    var c = Array.prototype.slice.call(arguments, 2, -1);
    var d = arguments[arguments.length - 1];
    return a * (b * d);
});

See the tests for fuller usage.

License

ISC.

FAQs

Package last updated on 28 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc