[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: define anywhere

From: Linus Björnstam
Subject: Re: define anywhere
Date: Sun, 06 Jun 2021 10:09:22 +0200
User-agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194

Note however, that I seem to have forgotten when and unless. also: cond has no 
support for the extended "test guard => lambda" form. Neither do I believe that 
the any "special" case form is supported. If there is any interest whatsoever, 
I can implement it when I have time.

The code produced is NOT the same as guile3 does for internal defines, however. 

(define a 2)
(define b 3)
(display "hej")
(define c 3)
(+ a b c)

becomes ONE letrec under gulie3, whereas my library turns it into
(letrec ((a 2) (b 3))
  (display "hej")
  (letrec ((c 3))
    (+ a b c)))

That should be an easy fix, again if there is any interest.
  Linus Björnstam

On Sat, 5 Jun 2021, at 17:23, Linus Björnstam wrote:
> I implemented this hack before guile 3 got defines in function bodies: 
> Even I guile 3 it allows a more liberal placement of define, but it 
> won't work for things like bodies of imported macros (like match)
> -- 
>   Linus Björnstam
> On Sat, 5 Jun 2021, at 00:27, Damien Mattei wrote:
> > hello,
> > i'm was considering that i want to be able to define a variable 
> > anywhere in
> > code, the way Python do. Few scheme can do that (Bigloo i know)
> > ( the list here is not exact:
> >
> > )
> >  is it possible in guile to do it? i do not know, so could it be added 
> > to
> > the language specification for future release?
> > 
> > regards,
> > Damien
> > 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]