Re: let binding with c

Damien MATTEI <[email protected]>
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
something i do not understand with bigloo and java front-end and that causes crash is when i use this macro:

 ;; macros or function to display a variable with a message and add a newline
(define-syntax display-msg-symb-nl 
  (syntax-rules ()
    ((_ msg symbl)   (begin
		       (display msg)
		       (display " ")
		       (display (symbol->string (quote symbl)))
		       (display " = ")
		       (display symbl)
		       (newline)))))

called like that:
(display-msg-symb-nl  "BiglooCode.scm :: ResultatMesuresF ::" objetexiste )

it seems symbol->string make the crash but i had no time to test it, so i let the problem and i use a simpler macro.

The macro works with others schemes implementation and perheaps with the C front-end.

Le Wednesday 19 October 2016 11:29:45 Damien MATTEI, vous avez écrit :
> ok thanks you 
> i hope the real bug in bigloo will be resolved because it's a nice tool.
> Damien
> 
> Le Wednesday 19 October 2016 10:50:15 Laurent Bloch, vous avez écrit :
> > Hi,
> > 
> > Le mercredi 19 octobre 2016 Damien MATTEI a écrit ceci :
> > 
> > > i'm using bigloo4.2c and have had a similar issue last year,i'm using bigloo with the java option enabled to generate JVM byte code and i noticed that 
> > > when creating string variables with nested define in function ,the code :
> > > 
> > > (define (ResultatMesuresFbeta bstr_identificateur bstr_objet)
> > >   
> > >   (display-var-nl "BiglooCode.scm :: ResultatMesuresFbeta :: bstr_identificateur = " bstr_identificateur)
> > >   (display-var-nl "BiglooCode.scm :: ResultatMesuresFbeta :: bstr_objet = " bstr_objet)
> > >     
> > >   (define len_bstr_identificateur (byte*-length bstr_identificateur))
> > >   (display-var-nl "BiglooCode.scm :: ResultatMesuresFbeta :: len_identificateur = " len_bstr_identificateur)
> > >   (display-var-nl "BiglooCode.scm :: ResultatMesuresFbeta :: (string? bstr_identificateur) = " (string? bstr_identificateur))
> > > 
> > >   (define identificateur (make-string len_bstr_identificateur))
> > >   ;;(define objet "")
> > > 
> > >   (set! identificateur  bstr_identificateur)
> > >   ;;(set! identificateur  (string-append bstr_identificateur))
> > > 
> > >   ;;(display-var-nl "BiglooCode.scm :: ResultatMesuresFbeta :: (string-append \"\" bstr_identificateur) = "  (string-append "" bstr_identificateur))
> > >   ;;(set! objet bstr_objet)
> > 
> > Hum, as far as I remember, nested define are only allowed at the
> > beginning of a body...
> > 
> > Cheers!
> > 
> 
> 
> 



-- 
[email protected], [email protected], UNS / OCA / CNRS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.