guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question


From: bciceron
Subject: Re: newbie question
Date: Sun, 11 Nov 2001 17:16:22 -0600 (CST)

-- >
-- > i'd like to know what is the proper way to call guile fct from a program
-- > in order to get the guile prompt when i run the program linked to
it.
-- >
-- > i've found 2 docs stating different aproaches:
-- >
-- > 1/ gh_enter(argc, argv, inner_main);
-- > 2/ scm_boot_guile(argc, argv, inner_main, 0);
-- >
-- > then both doc suggest calling ./pgm without arg an this should return
-- > guile prompt back.
-- >
-- > well it doesn't return anything in my case and complain about usage.
-- 
-- Could you please be more specific, especially:
-- 
-- * How exactly do you call these functions,

void inner_main(int argc, char *argv[])
{
        register_procs();
        gh_repl(argc, argv);
}

int main(int argc, char *argv[])
{

        gh_enter(argc, argv, inner_main);
        return 0;
}

-- * What is the exact error message.

./pgm

ERROR: In procedure sigaction in expression (sigaction (car sig-msg)
(make-handler #)):
ERROR: Invalid argument

same with :
./pgm -- foo

-- 
-- > please not other option including script and scheme intructions between
-- > single quote work fine with my program.

./pgm -c '(display (+ 2 3))'
5

-- > so i build correctly , but i'd also like to get guile> when using the
-- > right comand line argument .
-- 
-- Sorry, I don't understand what you are saying here.

i read there is a way to get the guile prompt and enter command
interactively, like this (simulating):

./pgm
guile>(display (+ 2 3))
5

-- 
-- > secondly i'd like to know if i understand correctly where to pass the
-- > program arguments .
-- > what is used to do before linking to guile, was :
-- > ./pgm arg1 arg2 arg3
-- >
-- > now readin the same (obsolete?) doc i found that arg should go after '--'
-- > , like in :
-- > ./pgm -- arg1 arg2 arg3
-- >
-- > then it argv[1..3] will point to them.
-- >
-- > is it a correct statement?
-- 
-- What do you mean by `argv' here?  The parameter passed to `main()'?

yes

-- Or the return value of Guile's `command-line' procedure?
-- 
-- I hope I can provide better help when given more information :)
-- 

thx,
regards,






reply via email to

[Prev in Thread] Current Thread [Next in Thread]