Shiro Kawai | 4 May 01:37 2007
Picon

Re: Empty Stack Trace

The gosh interpreter has been broken last few releases in
a way that it doesn't show stack traces when invoked in the
script mode.  It is due to my oversight of the API change,
and the fundamental fix will take some time.  Meanwhile,
the following is a quick patch against 0.8.10 src/main.c
that effectively reverts to the old API behavior.

--shiro

=====================
--- main.c.orig	2007-04-11 17:26:55.000000000 -1000
+++ main.c	2007-05-03 13:16:21.000000000 -1000
 <at>  <at>  -473,6 +473,7  <at>  <at> 
         mainproc = Scm_SymbolValue(Scm_UserModule(),
                                    SCM_SYMBOL(SCM_INTERN("main")));
         if (SCM_PROCEDUREP(mainproc)) {
+#if 0
             int r = Scm_Apply(mainproc, SCM_LIST1(av), &epak);
             if (r > 0) {
                 ScmObj res = epak.results[0];
 <at>  <at>  -482,6 +483,11  <at>  <at> 
                 Scm_ReportError(epak.exception);
                 exit_code = 70;  /* EX_SOFTWARE, see SRFI-22. */
             }
+#else
+            ScmObj r = Scm_ApplyRec(mainproc, SCM_LIST1(av));
+            if (SCM_INTP(r)) exit_code = SCM_INT_VALUE(r);
+            else exit_code = 70;
+#endif
         }
(Continue reading)

Michal Maruška | 9 May 10:49 2007
Picon

Re: Release 0.8.10


(in 0.8.10 ... )
there is also a change in Scm_MakeHashTable:

if `hashfn' argument is not any of SCM_HASH_EQ ..... then Scm_MakeHashTableFull
is NOT called anymore.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Shiro Kawai | 10 May 03:22 2007
Picon

Re: Release 0.8.10

Oops, did this bite you?

I #ifdef-ed out Scm_MakeHashTableFull-related stuff since I wanted
some time to reconsider generalized hash tables (esp. for consistent
inteface with weak hash tables).  If you're using the old behavior,
though, I'd be happy to revert the change.

--shiro

From: mmc <at> maruska.dyndns.org (Michal Maruška)
Subject: Re: [Gauche-devel] Release 0.8.10
Date: Wed, 09 May 2007 10:49:26 +0200

> (in 0.8.10 ... )
> there is also a change in Scm_MakeHashTable:
> 
> if `hashfn' argument is not any of SCM_HASH_EQ ..... then Scm_MakeHashTableFull
> is NOT called anymore.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gauche-devel mailing list
> Gauche-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gauche-devel
> 

(Continue reading)

Michal Maruška | 10 May 10:21 2007
Picon

note on regexp


I want to match a prefix terminated by unquoted #:

$ echo "quite a long string indeed, \\# still longer" | grep -E '^(([^#\\]+|(\\.)+)+)#'
   works ok, immediately

$ gosh
gosh> (rxmatch #/^(?:(?:[^#\\]+|(?:\\.)+)+)#/ "quite a long string indeed, \\# still longer")

takes time non linear, in the string-lenght, when adding to that string.

"Positive/negative lookahead assertion"  solves the problem:

(rxmatch #/^(?:(?:[^#\\]+(?=[#\\])|(?:\\.)+)+)#/ "quite a long string indeed, still longer")

Why is that? Is that documented? (Or am I wrong?)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Masatake YAMATO | 10 May 11:49 2007

emitting C code from scheme

Does anyone know a good scheme library that emits C code from 
S expression. Following is a simple example what I'm looking for:

   (c-code-emitter '(typedef int Integer) port)
=>
   typedef int Integer;

Not only scheme but also elisp is acceptable.

Regards,
Masatake YAMATO

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Shiro Kawai | 10 May 11:55 2007
Picon

Re: emitting C code from scheme

I'm just writing one.  Will commit to CVS in a few days.
I intend to use it to replace most C code fragments in *.stub
files, and eventually to auto-generate VM from instruction
definitions.

--shiro

From: Masatake YAMATO <jet <at> gyve.org>
Subject: [Gauche-devel] emitting C code from scheme
Date: Thu, 10 May 2007 18:49:54 +0900 (JST)

> Does anyone know a good scheme library that emits C code from 
> S expression. Following is a simple example what I'm looking for:
> 
>    (c-code-emitter '(typedef int Integer) port)
> =>
>    typedef int Integer;
> 
> Not only scheme but also elisp is acceptable.
> 
> Regards,
> Masatake YAMATO
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gauche-devel mailing list
(Continue reading)

Masatake YAMATO | 10 May 12:11 2007

Re: emitting C code from scheme

> I'm just writing one.  Will commit to CVS in a few days.
> I intend to use it to replace most C code fragments in *.stub
> files, and eventually to auto-generate VM from instruction
> definitions.

Amazing. Could you announce when you commit it to the
repository? I'm interested that how you handle indentation.

> Does anyone know a good scheme library that emits C code from 
> S expression. Following is a simple example what I'm looking for:
> 
>    (c-code-emitter '(typedef int Integer) port)
> =>
>    typedef int Integer;
> 
> Not only scheme but also elisp is acceptable.
> 
> Regards,
> Masatake YAMATO

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Shiro Kawai | 10 May 15:44 2007
Picon

Re: emitting C code from scheme

From: Masatake YAMATO <jet <at> gyve.org>
Subject: Re: [Gauche-devel] emitting C code from scheme
Date: Thu, 10 May 2007 19:11:49 +0900 (JST)

> > I'm just writing one.  Will commit to CVS in a few days.
> > I intend to use it to replace most C code fragments in *.stub
> > files, and eventually to auto-generate VM from instruction
> > definitions.
> 
> Amazing. Could you announce when you commit it to the
> repository?

Usually I don't publicly announce a feature until I write
certain amount of code with it and am convinced the API
is good enough.  But since you asked, I'll notify here when
I commit it.

> I'm interested that how you handle indentation.

Simple.  I don't.  The output isn't indented at all;

--shiro

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
clemens fischer | 10 May 17:39 2007

Re: note on regexp

> Michal Maruška:

> $ gosh
> gosh> (rxmatch #/^(?:(?:[^#\\]+|(?:\\.)+)+)#/ "quite a long string indeed, \\# still longer")
> 
> takes time non linear, in the string-lenght, when adding to that string.
> 
> "Positive/negative lookahead assertion"  solves the problem:
> 
> (rxmatch #/^(?:(?:[^#\\]+(?=[#\\])|(?:\\.)+)+)#/ "quite a long string indeed, still longer")
> 
> Why is that? Is that documented? (Or am I wrong?)

  #/^(?:(?:[^#\\]+|(?:\\.)+)+)#/
  #/^(?:(?:[^#\\]+(?=[#\\])|(?:\\.)+)+)#/

i'm no real expert, but lookaheads allow optimizations.  the first
rxmatch contains the `+' quantifier, which inserts backtracking points,
while the assertion just inserts a binary check for "is-present".

regards, clemens

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Bill Schottstaedt | 10 May 19:40 2007
Picon

gauche 0.8.10 on solaris 2.10

On Solaris 2.10 (x86-64), building Gauche 0.8.10 stops with:

gcc -DHAVE_CONFIG_H -I. -I./../gc/include   -g -O2 -fPIC -fomit-frame-pointer  -c sig
nal.c
signal.c: In function `Scm_SigWait':
signal.c:881: error: too many arguments to function `sigwait'
make[1]: *** [signal.o] Error 1
make[1]: Leaving directory `/home/bil/test/Gauche-0.8.10/src'

man sigwait:

NAME
     sigwait - wait until a signal is posted

SYNOPSIS
     #include <signal.h>

     int sigwait(sigset_t *set);

  Standard conforming
     cc [ flag ... ] file ... -D_POSIX_PTHREAD_SEMANTICS [ library...]
     #include <signal.h>

     int sigwait(const sigset_t *set, int *sig);

So I changed that code to:

    if (failed_sig < 0) {
        (void)SCM_INTERNAL_MUTEX_UNLOCK(sigHandlers.mutex);
        sigwait_called = TRUE;
(Continue reading)


Gmane