[erlang-questions] two beginners questions

Sean Cribbs sean@REDACTED
Mon Apr 14 23:03:52 CEST 2014

On Mon, Apr 14, 2014 at 1:49 PM, Roelof Wobben <r.wobben@REDACTED> wrote:

> Hello,
> I have two beginners question.
> 1) I start learning by the tryerlang site. And I did succeed in the list
> part. But the last question is to display the HEAD and TAIL. How do I do
> that.
It gives you the answer, actually:

[Head|Tail] = [a, b, c, d, e]

Head is the head of the list and Tail is the tail, bound by the
pattern-matching statement. Alternatively, you can use the built-in
functions hd/1 and tl/1, e.g. if I have a list in the variable List,
hd(List) gives the head and tl(List) gives the tail.

2) I like to use Sublimetext as a IDE. But how do I make a programm then
> run.
When you have compiled, either manually via erlc or with a build tool, run
"erl" and call the function in the module you want to run. Nothing
IDE-specific there, sorry.

Suggested next resource: learnyousomeerlang.com

Sean Cribbs <sean@REDACTED>
Software Engineer
Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140414/3fb9516e/attachment.htm>

More information about the erlang-questions mailing list