Todd Dukes | 4 Jun 22:24
Favicon

determining if a variable is bound


Is there any way to determine if a variable is bound in the current
context?

I have something like

(let ((x 1)
      (y 2))
  (user-code))

Where the top part of the let block is constructed programmatically,
the user code is inserted and the whole thing is passed to eval. 

I would like to have something like this in the user-code:

(if (bound? z)
    (+ x y z)
   (+ x y))

Does this capability exist?

Thanks,
Todd.

Manuel.Serrano | 13 Jun 12:24

Re: determining if a variable is bound

Hello Todd,

> Is there any way to determine if a variable is bound in the current
> context?
> 
> 
> I have something like
> 
> (let ((x 1)
>       (y 2))
>   (user-code))
> 
> 
> Where the top part of the let block is constructed programmatically,
> the user code is inserted and the whole thing is passed to eval. 
> 
> I would like to have something like this in the user-code:
> 
> (if (bound? z)
>     (+ x y z)
>    (+ x y))
> 
> 
> Does this capability exist?
No, it does not. This could make sense for the interpreter but not for
the compiler.

--

-- 
Manuel

(Continue reading)

Todd Dukes | 13 Jun 15:53
Favicon

Re: determining if a variable is bound


I tried to accomplish this with macros and exceptions, and it
may be possible, but I gave up.

I solved this for my user by generating the code like this:

  (let ((x 1)
        (y 2)
	(ident-list '(x y)))
    (user-code))

And instruct the user to write there code like this:

   (if (member 'z ident-list)
    (+ x y z)
    (+ x y))

Thanks,
Todd.

>>>>> "Manuel" == Manuel Serrano <Manuel.Serrano <at> sophia.inria.fr> writes:

    Manuel> Hello Todd,
    >> Is there any way to determine if a variable is bound in the
    >> current context?
    >> 
    >> 
    >> I have something like
    >> 
    >> (let ((x 1) (y 2)) (user-code))
(Continue reading)

Siegfried Gonzi | 24 Jun 17:51

unexpected problem when using int*set! on Mac OS X

Hello:

I am tring to write a binding to lapack and blas. However, the following code does not work. NOTE: I am using
the very same wrapper function on my Mac OS X and Bigloo3.0d for my binding to my plotting library DISLIN. IN
THIS CASE EVERYTHING works fine. I have no idea why the following does not work because I can use it antime
for my DISLIN binding. I even copied it over to my cblas directory. Please can someone with a Mac OS X copy it
into his Emacs and report what happens on his machine:

$ bigloo test.scm

Thanks, Siegfried Gonzi

==
(module test)

(define (vec2float* v)
   (if (float*? v)
       v
       (begin
	  (let* ((v-in  (if (list? v)
			    (list->vector v)
			    v))
		 (dim (vector-length v-in))
		 (erg (make-float* dim)))
	     (do ((i 0 (+ 1 i)))
		 ((= i dim) erg)
		 (let ((dummy (vector-ref v-in i)))
		    (float*-set! erg i (exact->inexact dummy))))))))

(define (vec2int* v)
(Continue reading)

Siegfried Gonzi | 25 Jun 10:47

Question to cigloo and f2c.h and clapack.h for my binding

Hello:

A typical lapack function in the C binding to lapack looks as follows in clapack.h header include file:

==
/* Subroutine */ int cbdsqr_(char *uplo, integer *n, integer *ncvt, integer *
	nru, integer *ncc, real *d__, real *e, complex *vt, integer *ldvt, 
	complex *u, integer *ldu, complex *c__, integer *ldc, real *rwork, 
	integer *info);
==

the type defintions are in the f2c.h header include file (clapack realizes the C binding by using the
automatic fortran to C compiler).

However, for my lapack binding in Bigloo I am faced now amongst other problems with the following.

I do not know how I can create now the external directives by means of cigloo for the types. Normally one uses
cigloo for the header files. 

I tried first to apply cigloo at the original f2c.h header file but it does not make it through because the
header file has a lot of strange #if defintions. However, I think I only need some basic type defintions
from that header files but also in that case cigloo complains. For example when I try the following:

f2c2.h
==
typedef long int integer;
typedef unsigned long int uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
(Continue reading)

Siegfried Gonzi | 26 Jun 10:36

Re: Question to cigloo and f2c.h and clapack.h for my binding

sorry for top posting. However, I now managed it that cigloo accepts the header files. Sometimes the C
standard - as far as I found out after some googling - allows two versions of type definitions but cigloo
often expects one particular one. At least now cigloo passes all the more tahn over 1000 clapack functions.

Still the problem with m wrapper functions (int*set! persists). I will try to install the latest Bigloo
over the weekend and test if the problem is still the same. At the moment I am using 3.0d.

Anyone here who has succeeded in installing or making a Bigloo binding to the gnu scientific library? It
seems that is not so eas an task because the gsl has a lot of peculiar tpe and structure defintions as opposed
to lapack where you onl have to deal with 'straightforward' function proto type defintions.

Regards, Siegfried
-------- Original-Nachricht --------
> Datum: Wed, 25 Jun 2008 10:47:26 +0200
> Von: "Siegfried Gonzi" <siegfried.gonzi <at> gmx.at>
> An: bigloo <at> sophia.inria.fr, Manuel.Serrano <at> sophia.inria.fr
> Betreff: [bigloo] Question to cigloo and f2c.h and clapack.h for my binding

> Hello:
> 
> A typical lapack function in the C binding to lapack looks as follows in
> clapack.h header include file:
> 
> ==
> /* Subroutine */ int cbdsqr_(char *uplo, integer *n, integer *ncvt,
> integer *
> 	nru, integer *ncc, real *d__, real *e, complex *vt, integer *ldvt, 
> 	complex *u, integer *ldu, complex *c__, integer *ldc, real *rwork, 
> 	integer *info);
> ==
(Continue reading)

Siegfried Gonzi | 27 Jun 10:30

update int*-set!

quick update. sorry for all my posts in the last few days. It was a basic mistake to assume Bigloo knows
int*-set! whereas there was no external C tpe defintion for it because the clapack had integer* as type
defintion. However, I still have problems with that integer*-set!. But I will figure it out.

Regards, Siegfried
--

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf <at> gmx

Manuel.Serrano | 22 Jul 10:17

Re: Question to cigloo and f2c.h and clapack.h for my binding

Hello Siegfried,

> A typical lapack function in the C binding to lapack looks as follows in clapack.h header include file:
> 
> ==
> /* Subroutine */ int cbdsqr_(char *uplo, integer *n, integer *ncvt, integer *
> 	nru, integer *ncc, real *d__, real *e, complex *vt, integer *ldvt, 
> 	complex *u, integer *ldu, complex *c__, integer *ldc, real *rwork, 
> 	integer *info);
> ==
> 
> the type defintions are in the f2c.h header include file (clapack realizes the C binding by using the
automatic fortran to C compiler).
> 
> However, for my lapack binding in Bigloo I am faced now amongst other problems with the following.
> 
> I do not know how I can create now the external directives by means of cigloo for the types. Normally one uses
cigloo for the header files. 
> 
> I tried first to apply cigloo at the original f2c.h header file but it does not make it through because the
header file has a lot of strange #if defintions. However, I think I only need some basic type defintions
from that header files but also in that case cigloo complains. For example when I try the following:
> 
> f2c2.h
> ==
> typedef long int integer;
> typedef unsigned long int uinteger;
> typedef char *address;
> typedef short int shortint;
> typedef float real;
(Continue reading)

Siegfried Gonzi | 22 Jul 11:53

Re: Question to cigloo and f2c.h and clapack.h for my binding

Thank very much Manuel:

In the meantime I have my lapack binding working (need some testing though before I start writing a short
documentation and make it public). I somehow managed it that cigloo accepts all the more than 1200 lapack functions.

see ou, siegfried

-------- Original-Nachricht --------
> Datum: Tue, 22 Jul 2008 10:17:04 +0200
> Von: Manuel.Serrano <at> sophia.inria.fr
> An: "Siegfried Gonzi" <siegfried.gonzi <at> gmx.at>
> CC: bigloo <at> sophia.inria.fr
> Betreff: Re: [bigloo] Question to cigloo and f2c.h and clapack.h for my binding

> Hello Siegfried,
> 
> > A typical lapack function in the C binding to lapack looks as follows in
> clapack.h header include file:
> > 
> > ==
> > /* Subroutine */ int cbdsqr_(char *uplo, integer *n, integer *ncvt,
> integer *
> > 	nru, integer *ncc, real *d__, real *e, complex *vt, integer *ldvt, 
> > 	complex *u, integer *ldu, complex *c__, integer *ldc, real *rwork, 
> > 	integer *info);
> > ==
> > 
> > the type defintions are in the f2c.h header include file (clapack
> realizes the C binding by using the automatic fortran to C compiler).
> > 
(Continue reading)

Manuel.Serrano | 4 Jul 15:43

Re: unexpected problem when using int*set! on Mac OS X

Hello Siegfried,

> I am tring to write a binding to lapack and blas. However, the following code does not work. NOTE: I am using
the very same wrapper function on my Mac OS X and Bigloo3.0d for my binding to my plotting library DISLIN. IN
THIS CASE EVERYTHING works fine. I have no idea why the following does not work because I can use it antime
for my DISLIN binding. I even copied it over to my cblas directory. Please can someone with a Mac OS X copy it
into his Emacs and report what happens on his machine:
> $ bigloo test.scm
> Thanks, Siegfried Gonzi
> ==
> (module test)
> (define (vec2float* v)
>    (if (float*? v)
>        v
>        (begin
> 	  (let* ((v-in  (if (list? v)
> 			    (list->vector v)
> 			    v))
> 		 (dim (vector-length v-in))
> 		 (erg (make-float* dim)))
> 	     (do ((i 0 (+ 1 i)))
> 		 ((= i dim) erg)
> 		 (let ((dummy (vector-ref v-in i)))
> 		    (float*-set! erg i (exact->inexact dummy))))))))
> (define (vec2int* v)
>    (if (int*? v)
>        v
>        (begin
> 	  (let* ((v-in (if (list? v)
> 			   (list->vector v)
(Continue reading)

Eduardo Costa | 21 Jun 23:19
Favicon

Re: Binaries for Windows

To whom it may concern.

Junia M. Rocha maintains an up to date binary distribution of Bigloo (and Stalin) at

code.google.com/p/stalingui

She also offers GTK bindings, list comprehensions,  and tutorials on GUI contruction, constraint programming (using list comprehensions), and Scheme. Her package comes with everything one may need to have Bigloo up and running on Windows, i. e., it comes with gcc, gmp, etc. All you need is to run her setup program, follow the instructions, and start programming in Bigloo; BTW, you can use her tutorials to learn Bigloo.

Besides Junia's distribution, there are two other binary Bigloo distributions for Windows. One of them is mainta ined by Yannis at http://www.yaya.fr/Bigloo/; Yannis' version is not up to date, which means that the last version of Bigloo is 3.1a, and the last version of Yannis'  Bigloo for Windows is 2.8c. Besides this, Bigloo for WIndows does not come with a C compiler. Junia's distribution includes a C compiler, and two GUI packages. On the other hand, Junia does not include the dotNet,  and the Java backend, which Yannis packs together with the C backend. However, Junia includes a ready to use Java GUI with her distribution; she also ships GTK bindings for people who do not like Java.



Gmane