On Tue, Oct 26, 2004 at 04:33:04PM +0200, Christian Jaeger wrote:
>
> 1.) the Inline::Guile docs say:
>          use Inline::Guile => <<END;
>   Of course this is wrong, should be: (took me some time to see!)
>          use Inline Guile => <<END;

Too true. I'll update the docs.
 
> 2.) the Inline docs make me believe, that this should work:
>     use Inline 'Guile';
> __END__
> __GUILE__
>   (define (square x ) (* x x))
> 
> but it doesn't.
> Neither does this:
> 
> use Inline 'Guile'=>'DATA';
> 
> or this:
> 
> use Inline 'Guile'=>'GUILE';
> 
> 
> 3.)
> use Inline 'Guile'=> <<'END';
>  (define (square x ) (* x x))
> END
>  ;
> my $ans= square(10);
> print $ans,"\n";
> 
> => Undefined subroutine &main::square called at ./versuch1 line 17.
>
> Ok the synopsis said (even if it's looking weird):
>  (define square ( x ) (* x x))
> so let's try this.
> ERROR: In procedure define:
> ERROR: missing or extra expression
> 
> (define square (lambda (x) (* x x)))
> ==> finally works. Why not the (define (square x) (* x x)) case?

That's the regex again.

I'm not sure I can do a parse of the environment since things like quit report
themselves as plain procedures - c.f.

guile> quit
#<procedure quit args>

so they look and smell like user functions. I think the best route is to make
the regex more intelligent - try

*** Guile-orig.pm       Wed Oct 27 01:39:25 2004
--- Guile.pm    Wed Oct 27 01:42:26 2004
***************
*** 64,70 ****
      unless $result == 1;
  
    # look for possible global defines
!   while($code =~ /define\s+(\S+)/g
          # + cperl-mode, I hate you.
         ){
      my $name = $1;
--- 64,70 ----
      unless $result == 1;
  
    # look for possible global defines
!   while($code =~ /^\s*[^;]*define\s+\(?(\S+)/g
          # + cperl-mode, I hate you.
         ){
      my $name = $1;

and tell me how you get on.

Note that the above is only vaguely tested and it's 1am local time so YM*W*V :)

-- 
Bring me my etherkiller; Oh clouds unfold! / Bring me the magic smoke of desire
I shall not cease from mental fight / Nor shall my LART rest in my hand
Till we have buried the bodies / Of all the lusers in all this land
  -- rpg, ASR                        [ My homepage is http://www.trout.me.uk/ ]

Reply via email to