Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defn keyword #3

Open
m3tti opened this issue Feb 14, 2017 · 1 comment
Open

Add defn keyword #3

m3tti opened this issue Feb 14, 2017 · 1 comment

Comments

@m3tti
Copy link

m3tti commented Feb 14, 2017

It would be nice if there is a keyword for
(def hello fn [] "Hello")
like in clojure
(defn hello [] "hello")

@yosbelms
Copy link
Owner

yosbelms commented Feb 15, 2017

@m3tti, I've thought of add defn, but I discarded the idea because defn should be a macro, and RamdaScript doesn't support macros. I prefer to keep things simple. Currently the way to define/export a function in RamdaScript is:

(def someFn (fn [] 'Hello'))

As you can see, a function is just a value. I recommend to break the line just after the parameter list for better readability, example:

(def someFn (fn []
    'Hello'))

I will publish a full-featured TodoMVC using RamdaScript, ReactJS, and Flyd soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants