Re: Modules

2010-12-09 Thread Andreas Rottmann
Marek Kubica  writes:

> Hi,
>
> I tried executing the modules example:
>
> $ cd guile-git/examples/module
> $ guile -s main
>
[...]
> ERROR: no code for module (module-0)
>
> Is there a way to add the current directory to the search path?
>
% guile --help | grep -i directory
  -L DIRECTORY   add DIRECTORY to the front of the module load path

So it's "guile -L . -s main" for the case above.

> I think this should be default, just like in Python, otherwise
> creating modules is a really big hassle.
>
I'm not sure this should be made the default; for an installed program
implemented in Guile, having "." implicitly in the load path would be
unneccessary and even a security issue.

Regards, Rotty
-- 
Andreas Rottmann -- 



Backquote simplification

2010-12-09 Thread Hans Aberg
Is it possible to simplify the backquote construct `(,x_1 ... ,x_k)  
(always unquote on all arguments) somehow, so that the unquote does  
not need to appear multiple times (depending on k)? (I construct these  
in the C-interface, and it would simplify not having to remove a  
sequence of them.)


Specifically, in
  (define g (lambda (x . y) `(,x . ,y)))
then evaluations like (g 1 2 3), (g 1 2 . (3 4)) work.

So I would want something like
  (define g (lambda (x . y) (b x . y
where (b x . y) might be any expression where the unquote does not  
need to appear on every variable. Only combinations line

  (define g (lambda (x . y) (b `(,x . ,y
seem to work.

  Hans





Re: Modules

2010-12-09 Thread Nala Ginrut
Maybe you can modify %load-path in your code. But I haven't  tested yet.
Good luck!