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

clojure like keywords ? #5

Closed
Gozala opened this issue Jun 22, 2012 · 4 comments
Closed

clojure like keywords ? #5

Gozala opened this issue Jun 22, 2012 · 4 comments

Comments

@Gozala
Copy link
Contributor

Gozala commented Jun 22, 2012

Can we get a clojure like keywords ?
In clojurescript they used pretty neat hack for that:
https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L1452-1458

I would probably just used some other prefix like ":" or "@" to make it easy for JS and silpy to collaborate:

:keyword => "@keyword"

@santoshrajan
Copy link
Owner

Hi Gozala, do we really need this. We already have the "." notation to dereferece properties. Do you have any specific problem I can see?

@Gozala
Copy link
Contributor Author

Gozala commented Jun 23, 2012

I think you misunderstand keywords. In clojure you don't need to define constants you just use them:
:pending, :realized. In JS you either define them up front var PENDING = 0, REALIZED = 1 or just use strings like:
`"pending", "realized". I was suggesting to take clojurescript's approach into a spin and prefix string with some character. That way it becomes just a convention of using strings for constants and prefxing them with some character to make sure they don't interfer with regular strings.

@ghost
Copy link

ghost commented Sep 21, 2012

I would like to use defun, def, defmacro, lambda ... rather than function, var, ... because I think LispyScript is much more for lisp and/to js programmers than js programmers . Using def, defun seems to be more friendly.

@santoshrajan
Copy link
Owner

@analysis918 LispyScript tries to maintain the JavaScript semantics as far as possible.

However it is very easy to write a set of macros that will mimic any other Lisp dialect.

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