This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bad define placement?


Richard Frith-Macdonald <richard@brainstorm.co.uk> writes:

> On 27 Aug 1999 08:43:19 -0500, james@tiger-marmalade.com wrote:
> > I've gotten a new error with 1.3.2 on some code that worked with 1.3.1:
> >
> > (define (foo bar)
> >   (display bar)
> >   (define c "World")
> >   (display c) )
> >
> > (foo "Hello ")
> >
> > This gives an error "Bad define placement".  Is the above code really
> > incorrect?
> 
> I have the same sort of problem - but in more complex situations - where I
> wasn't sure whether my code was correct or not (being more of an Objective-C
> programmer than a Guile programmer).  I wasn't going to report it as a bug
> until I was sure it wasn't my fault - but it seems I'm not the only one
> suffering...

It is a bug.

From R5RS:

"Definitions may occur at the beginning of a <body> (that is, the body
 of a lambda, let, let*, letrec, let-syntax, or letrec-syntax expression
 or that of a definition of an appropriate form)."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]