Quantcast

Learning Erlang from the Armstrong book

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Learning Erlang from the Armstrong book

Tony Cappellini-2
Learning a new language is always a pain.

Having a "popular book" being recommended as "the place to start
from", then struggling trying to figure out why the code in the
"recommended book" doesn't work is even more frustrating.
Almost 50 pages into the book the author has a panel which reads" Some
readers have mistakenly typed into the shell fragements ocf code
contained in the source code listings. These are not valid shell
commands and you will get some strange error message if you try to do
this".

Why is this not in the front of the book? ;-)

So how is a newbie supposed to know which code in the "recommended"
book is valid?
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Learning Erlang from the Armstrong book

David Mitchell-5-2
I don't have the book handy at the moment so I can't check the panel
you're referring to, but I can't recall having problems learning
Erlang from Joe's book.  I knew of Erlang's existence, and I'd been
reading *about* it for a while, but I'd never encountered Erlang code
before I opened the book for the first time.

I struggled with OTP because it wasn't covered (much) in the book, but
I thought the coverage of the Erlang language itself was very good.
In particular, I don't recall any problem running the examples,
although I probably didn't try every single one.

Dave M.

2008/11/5 Tony Cappellini <[hidden email]>:

> Learning a new language is always a pain.
>
> Having a "popular book" being recommended as "the place to start
> from", then struggling trying to figure out why the code in the
> "recommended book" doesn't work is even more frustrating.
> Almost 50 pages into the book the author has a panel which reads" Some
> readers have mistakenly typed into the shell fragements ocf code
> contained in the source code listings. These are not valid shell
> commands and you will get some strange error message if you try to do
> this".
>
> Why is this not in the front of the book? ;-)
>
> So how is a newbie supposed to know which code in the "recommended"
> book is valid?
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Learning Erlang from the Armstrong book

Lev Walkin
In reply to this post by Tony Cappellini-2
Tony Cappellini wrote:

> Learning a new language is always a pain.
>
> Having a "popular book" being recommended as "the place to start
> from", then struggling trying to figure out why the code in the
> "recommended book" doesn't work is even more frustrating.
> Almost 50 pages into the book the author has a panel which reads" Some
> readers have mistakenly typed into the shell fragements ocf code
> contained in the source code listings. These are not valid shell
> commands and you will get some strange error message if you try to do
> this".
>
> Why is this not in the front of the book? ;-)
>
> So how is a newbie supposed to know which code in the "recommended"
> book is valid?

The book has many pages. If one start from some random page, there's
always a chance of missing some of the important statements earlier
in the book. If one reads through the book right from the beginning,
there's certainly less chance to overlook something fundamental.

That said, let's check the facts. The following notice appears
precisely at the 27'th page, the very _next_ page after the very
_first_ example involving the shell (page 28):

        Warning: You can’t type everything you read in this book into
        the shell. In particular, you can’t type the code that’s listed
        in the Erlang program files into the shell. The syntactic for ms
        in an .erl file are not expressions and are not understood by the
        shell. The shell can evaluate only Erlang expressions and
        doesn’t understand anything else. In particular, you can’t type
        module annotations into the shell; these are things that start
        with a hyphen (such as -module, -export, and so on).


--
Lev Walkin
[hidden email]
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Learning Erlang from the Armstrong book

Tony Cappellini-2
I didn't start on a random page. I've read it from the beginning to page 48- This is the page where the quote is that I posted in my message.

>>That said, let's check the facts. The following notice appears
>>precisely at the 27'th page, the very _next_ page after the very
>>_first_ example involving the shell (page 28):
 This quote appears on Page 14 in my book. It's likely we have different printings

       >>Warning: You can't type everything you read in this book into
I probably read this last week or so, when I had first started reading the book, but it's soemthing that didn't stick with me.
I'm just spoiled with languages where I can type anything into their shells (syntactically correct that is)

Is the code on page 54 supposed to work in the shell?


_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Learning Erlang from the Armstrong book

zambal
In reply to this post by Tony Cappellini-2
On 5 nov, 06:08, "Tony Cappellini" <[hidden email]> wrote:
> So how is a newbie supposed to know which code in the "recommended"
> book is valid?

All code in the book is valid. It's just that not all code are valid
shell expressions.

Maybe this seems odd in the beginning, but as you learn more about the
language,the run-time system and how code is organised, it starts to
make sense.

For now, you just have to remember the used convention in the book
that code examples that should be run from the shell start with a
shell command prompt like this:

1> .....
2> .....
3> etc.

and the rest of all examples is code that should be written in an
erlang source file (*.erl files). These code listings are typically
function definitions that look like this:

some_funtion(Parameter) ->
    ...,
    ....

another_funtion() ->
    ...,
    ....


Good luck with learning Erlang. After the basics it should really
become fun!

--
vincent


_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Learning Erlang from the Armstrong book

Dave Smith-23
In reply to this post by Tony Cappellini-2

>>I'm just spoiled with languages where I can type anything into their shells (syntactically correct

It's a minor limitation -- I think you'll find the shell to be a very useful tool.  And Joe's book is an excellent introduction to the language.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Loading...