Erlang/OTP Forums

Author Message

<  Advanced Erlang/OTP  ~  include on erl shell

vim
Posted: Wed Oct 22, 2008 10:46 pm Reply with quote
User Joined: 01 Oct 2008 Posts: 19
Hi, i need to know if there is a way to add include path to the erl shell.

Normally i use erlc with -I/include/path flag, but sometimes i want to compile and test as i code, so i invoke the shell and try to compile my code, but i am missing the includes.

it seems there is no -I equivalent for erl, a workaround i thought of, it to define a function C:
Code:
C = fun(Filename) -> compile:file(Filename, [{i,"/include/path"}, {i,"/more/include/path"}]) end.


this works, but i want to add it to the erl command line so it will be there automatically. i tried -eval, but it doesn't 'remember' it on the shell.

btw, i know of compile:file("mymod.erl", [{i, "..."}]) , but i don't want to write it every time, i need a way to load it on shell start.

any suggestions?
View user's profile Send private message
saite
Posted: Thu Oct 23, 2008 10:30 pm Reply with quote
Joined: 23 Oct 2008 Posts: 1
you could use the environment variable ERL_COMPILER_OPTIONS.
View user's profile Send private message
vim
Posted: Sat Oct 25, 2008 10:36 pm Reply with quote
User Joined: 01 Oct 2008 Posts: 19
well, i solved my problem by including the 'include' directory path on the -include directive, i.e.

what once was:
-include("proj.hrl").

is now:
-include("$INCLUDE/proj.hrl").

and $INCLUDE is set as environment variable to point to my include dir.

on the same issue, is it possible to set a define for the erl shell? i.e. i want the macro ?debug to be set when i open my erl shell, is there a way to do this automatically when i open erl?
View user's profile Send private message
wuji
Posted: Tue Sep 18, 2012 6:33 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
the expense of our villain, Rex, and not at the the cheap authentic jordans the expense of those suffering from the disease."The joke, "From
man to another, I hope you get Lou Gehrig's disease," disease," cheap replica designer *beep* disease," shocked movie-going patients and advocates, who say it crossed
line."I didn't expect to go to a movie and sit sit cheap authentic jordans sit with an audience laughing at the expense of people
ALS," said Randy Pipkin, who was diagnosed in 2005. "I "I [h4]replica designer bags for sale[/h4] "I think the message this film sends out is a
slap in the face to people dying from this horrific horrific [h4]authentic jordans[/h4] horrific disease."Lou Gehrig's disease, also known as ALS, progressively robs
of their ability to move, speak, eat and breathe. There There authentic jordans There is currently no cure.The punch line prompted an online
urging MacFarlane to apologize and donate $200,000 of the movie's movie's replica designer *beep* movie's proceedings to ALS research."The thing that Mr. MacFarlane and
fail to realize is that ALS sufferers are some of of [h4]cheap authentic jordans[/h4] of the kindest, compassionate, thoughtful, and loving individuals one will
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum