Live data from Hacker News

Lisp Flavoured Erlang 1.0 released after 8 years of development

github.com

91–96 of 96 posts

Re: Lisp Flavoured Erlang 1.0 released after 8 years of development

#91
post #89
post #88

Earlier quoted context omitted.

Please keep programming language flamewars off HN.

The first part was a question and the second two parts were examples. Writers can't be held responsible for the lack of reading comprehension exhibited by audience members.

No, you broke the rules flagrantly:

> Ruby-til-Death programmers refuse to learn any other non-ruby-like syntax? It's like their brains would shatter into a brillion pieces

You've posted chest-beating things like this before, too. It's destructive to the community, so please don't do it. If you're smarter or more knowledgeable than other readers, use your greater power to improve the quality of HN, not degrade it.

We detached this subthread from https://news.ycombinator.com/item?id=11303413 and marked it off-topic.

Re: Lisp Flavoured Erlang 1.0 released after 8 years of development

#92
post #53

Earlier quoted context omitted.

Map is a constructor in this case. You'll want lists:map/2 (fn comes first). I don't know LFE much so there may be sugar of sorts for this, perhaps a comprehension syntax.

Yes, there are list comprehensions but they return the list of values: (lc ((<- x (lists:seq 1 10))) (lfe_io:format "~p" x))

Thank you both. I didn't realize how Erlang flawored this really is. This did the trick:

    > (lists:map (lambda (a) (io:format (integer_to_list a))) (lists:seq 1 10))
Though all those OKs look kind of superfluous. I must read Erlang tutorial or two before I proceed.

Re: Lisp Flavoured Erlang 1.0 released after 8 years of development

#93
post #64

The users manual has a stub section for macros; does anybody know how LFE macros work? It says "lisp style" but that allows at least 4 options (syntax pattern-matching versus classic defmacro, and capturing versus non-capturing).

There's some more in-depth documentation in the repo in doc/user_guide.txt, at around line 520-ish.

It has Common Lisp style defmacro (augmented with pattern matching), and Scheme-inspired defsyntax. The documentation warns that both are unhygienic, and `grep -ri gensym` didn't find anything in the repo.

Re: Lisp Flavoured Erlang 1.0 released after 8 years of development

#95
post #64

The users manual has a stub section for macros; does anybody know how LFE macros work? It says "lisp style" but that allows at least 4 options (syntax pattern-matching versus classic defmacro, and capturing versus non-capturing).

There's some more in-depth documentation in the repo in doc/user_guide.txt, at around line 520-ish. It has Common Lisp style defmacro (augmented with pattern matching), and Scheme-inspired defsyntax. The documentation warns that both are unhygienic, and `grep -ri gensym` didn't find anything in the repo.

So I guess you just have to be super careful with variable and function names? That's the dark-ages for lisp, but still usable.

Re: Lisp Flavoured Erlang 1.0 released after 8 years of development

#96

Earlier quoted context omitted.

Yes, there are list comprehensions but they return the list of values: (lc ((<- x (lists:seq 1 10))) (lfe_io:format "~p" x))

Thank you both. I didn't realize how Erlang flawored this really is. This did the trick: > (lists:map (lambda (a) (io:format (integer_to_list a))) (lists:seq 1 10)) Though all those OKs look kind of superfluous. I must read Erlang tutorial or two before I proceed.

io:format is a side-effecting function. It prints to the terminal. The atom ok is the return value.

If you want to create a list of strings, this works:

    > (lists:map (lambda (a) (lists:flatten (io_lib:format "~B" (list a)))) (lists:seq 1 10)).
    ("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
Post reply on HN