defining functions in startup file

Happi <>
Wed Nov 14 20:57:01 CET 2001


Yes there is a better way of customizing your environment, quoting the
documentation of shell_default:
http://www.erlang.org/doc/r7b/lib/stdlib-1.9.1/doc/html/application_frame.ht
ml

  To add your own commands to the shell, create a module called user_default
   and add the commands you want. Then add the following line as the first
line
   in your .erlang file in your home directory.

   code:load_abs("$PATH/user_default").

/Erik

org: Eric Conspiracy Secret Laboratories
I'm Happi, you should be happy!

----- Original Message -----
From: "Garry Hodgson" <>
To: "Erlang" <>
Sent: Wednesday, November 14, 2001 8:42 PM
Subject: defining functions in startup file


>
> i'd like to define some simple functions to use while working in
> the erlang interpreter, like one to edit a module, given its name,
> and things like that.
>
> at the prompt, i can manually type something like:
>
>     E = fun( Module ) ->
>               os:cmd( "fred " ++ atom_to_list( Module ) ++ ".erl" )
>         end.
>
> and then use:
>
>     E( foo ).
>
> to edit "foo.erl".  a small convenience.
> but if i put the above in my .erlang file, i can't use it once
> erlang's started.  how do i make this work, or is there a better
> mechanism for customizing my environment?
>
> thanks
>
> --
> Garry Hodgson                   One way or another
> Senior Hacker                   One way or another
> Software Innovation Services    One way or another
> AT&T Labs                       This darkness got to give...
> 
>





More information about the erlang-questions mailing list