[erlang-questions] some language changes
Ulf Wiger (TN/EAB)
ulf.wiger@REDACTED
Wed May 23 16:39:08 CEST 2007
I started playing with the idea of being able to define
modules pretty much the same way as records are handled
in the shell.
For example:
1> md("
-module(foo).
...
plus(A,B) -> A+B.
").
{module, foo}
2> foo:plus(1,2).
3
But a few stumbling blocks made me abort the effort
(that, and my bus ride ended, and I had to hop onto
my bike - I've yet to learn how to program while
riding a mountain bike).
One problem is that epp is not willing to take
just a stream of bytes (this has been discussed
before on this list), but desperately wants to
read a regular file.
Another problem is that the shell is decidedly
line-oriented, so it doesn't look like I sketched
above, but rather:
1> md("
1> -module(foo).
1> ...
And you cannot move the cursor up a line, making it
cumbersome to edit the code in this mode.
It may still be worth it, though.
BR,
Ulf W
> -----Original Message-----
> From: erlang-questions-bounces@REDACTED
> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Mike Berrow
> Sent: den 23 maj 2007 16:21
> To: Erlang (E-mail)
> Subject: Re: [erlang-questions] some language changes
>
> ok wrote:
> > On 21 May 2007, at 8:10 pm, Joe Armstrong wrote:
> >> 1. What you type in the shell and what you type in a
> module/escript
> >> should be the same
> > ...
> > This has never been the case in Smalltalk, and nobody seems
> to notice
> > any problem.
> > ...
>
> I've used Smalltalk and I've been making a living programming
> in Ruby for the last 18 months. Now that you point that out,
> it is one of the large advantages that Ruby has over
> Smalltalk w.r.t experimentation / prototyping / learning curve
>
> > It has never been the case in Prolog.
> > ....
> Is Erlang tied to Prolog in this? If not, why does that matter?
>
> > And that's a really important point. Joe is suggesting that the
> > Erlang shell should be changed to make it easier for beginners to
> > shoot themselves in the foot, instead of learning practices
> that will
> > help to keep them out of trouble. I cannot think that a good idea.
>
> I've found the transparency between the interactive shell and
> source environments in Ruby to be nothing but a huge boost in
> productivity.
> I've never had this "shooting myself in the foot" effect
> because of it.
> If there is something intrinsically different about the
> Erlang world that makes it dangerous, I would appreciate it
> if you could elaborate.
>
> Thanks much,
> -- Mike Berrow
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list