(defun foo (message)
(let (((tuple len status data) message))
...))
(defun foo {
len status data
}
...)
(defun Area {square Length Height}
(* Length Height))
(defun Tally ({Quantity Product} | T)
(+ Quantity (Tally T))
On Oct 16, 2016, at 10:49 PM, TR NS <tran...@gmail.com> wrote:
Today I was wondering if the world really needed yet another Lisp. Lisp has tried so many times to get off the ground and has never quite been able to get there. Presently Clojure seems the "best great hope" for Lisp, but I doubt it will ever really get huge. And if we are being honest, Clojure has a bit more going for it than LFE.
So I was thinking maybe LFE would be better off it stopped trying to be an EFL -- Erlang flavored Lisp, and really turn a corner to become something more than Lisp -- to really embrace its name LFE as an Erlang first, but with a Lisp style.
What do I mean by this? Well one example is to consider function definitions. LFE just has your old-school list style functions, taking a list of parameters. But Erlang's functions are full-on pattern-matches.
So for example, instead of something like:(defun foo (message)
(let (((tuple len status data) message)) ...))
Just go for it with:
(defun foo {
len status data
}
…)
Going further, in Erlang all variables start with a capital letter, so it can use unadorned atoms for pattern matching. That's a pretty nice feature. Lisp requires a prefix, like an apostrophe. Lets embrace the Erlang,(defun Area {square Length Height}
(* Length Height))
(Area square 10 10
Consider another example, using Erlang H | T notation,
(defun Tally ({Quantity Product} | T)
(+ Quantity (Tally T))
(Tally {10 apples} {2 pies} {3 soups})
So in short, instead of just being another Lisp with Erlang underpinnings, maybe it would be better to embrace the Erlang and put a really sexy Lisp-esque dress on her.
Just a thought.
--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at https://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@googlegroups.com.
Visit this group at https://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@googlegroups.com.
On Oct 16, 2016, at 10:49 PM, TR NS <tran...@gmail.com> wrote:Today I was wondering if the world really needed yet another Lisp. Lisp has tried so many times to get off the ground and has never quite been able to get there. Presently Clojure seems the "best great hope" for Lisp, but I doubt it will ever really get huge. And if we are being honest, Clojure has a bit more going for it than LFE.
So I was thinking maybe LFE would be better off it stopped trying to be an EFL -- Erlang flavored Lisp, and really turn a corner to become something more than Lisp -- to really embrace its name LFE as an Erlang first, but with a Lisp style.
What do I mean by this? Well one example is to consider function definitions. LFE just has your old-school list style functions, taking a list of parameters. But Erlang's functions are full-on pattern-matches.
So for example, instead of something like:(defun foo (message)
(let (((tuple len status data) message)) ...))
Just go for it with:(defun foo {
len status data
}
…)We already support such pattern matching using function clauses like this:(defun foo([(= (tuple len status data) message)]…))or in an anonymous function like this:(match-lambda([(= (tuple len status data) message)]...))
Going further, in Erlang all variables start with a capital letter, so it can use unadorned atoms for pattern matching. That's a pretty nice feature. Lisp requires a prefix, like an apostrophe. Lets embrace the Erlang,(defun Area {square Length Height}
(* Length Height))
(Area square 10 10)
I don’t follow this example. Is square supposed to be a record? If so, we can do this:
> (defrecord square length height)set-square-height> (defun area> ([(match-square length length height height)]> (* length height)))area> (area (make-square length 10 height 10))100If it’s supposed to be the atom ‘square, then we can do:> (defun area> (['square length height]> (* length height)))area> (area 'square 10 10)100
Consider another example, using Erlang H | T notation,
(defun Tally ({Quantity Product} | T)
(+ Quantity (Tally T))
(Tally {10 apples} {2 pies} {3 soups})I don’t follow this example either. I’m assuming you mean something like this:
> (defun tally> ([()] 0)> ([`(#(,quantity ,_product) . ,t)]> (+ quantity (tally t))))tally> (tally '[#(10 apples) #(2 pies) #(3 soups)])15
A quick comment to Mike's comments:
Yes, the thing to remember is the homoiconcity of lispand that you are really just writing down a data structure which is *interpreted* as code. This is what makes lisp's macro facility so powerful.
Also the Elixir syntax, while it may feel comfortable to many, is actually quite complex and you can run into problems if you arenot careful.
I am travelling at the moment and will come with a longer comment later.
Robert
At the risk of sounding like an ass, I'll paraphrase Spoon Boy:
Do not try and change the Lisp syntax, that's impossible.
Instead, only try to realize the truth...there is no Lisp syntax.
Then you will see it is not the Lisp that bends, it is only yourself.
My point is that there can be only "Lisp, the Continuing Mission," but
that mission is to give you the simplest machinery for _you_ to
innovate on top--the programmable programming language. If you just
want a more concise syntax, suited to human rather than macro
consumption, you don't want Lisp. Maybe you want Elixir.
I don't have any experience with Lisp besides LFE. When I started, I found the pattern matching form of defun to be incredibly confusing. After working with it a little bit, I don't even think about it anymore -- it makes sense! (Incidentally, I read people saying that when I started out and thought it was bunk and played around with different ways of representing it.)
I think your premises are flawed if you think there's a syntax problem with both Erlang and LFE. I came to LFE to get away from Erlang syntax but instead have grown to like them both *a lot*.
There is still a lot of work to be done with LFE but it's absolutely on the right track.
I don't have any experience with Lisp besides LFE. When I started, I found the pattern matching form of defun to be incredibly confusing. After working with it a little bit, I don't even think about it anymore -- it makes sense! (Incidentally, I read people saying that when I started out and thought it was bunk and played around with different ways of representing it.)