-[ Fri, Aug 27, 2010 at 04:04:25PM +0200, Andreas Rottmann ]----
> > guile> (use-syntax (ice-9 syncase))
> > guile> (if #t (define foo "bar"))
> > ERROR: invalid context for definition of foo
> > (...)
> >
> I think it's establishing stricter rules for `define' placement.  Note
> that your code is not legal (R5RS) Scheme -- the define is misplaced;
> it's neither a top-level nor an internal define. 
> (...)
> What do you want to achieve in your code?

I'm doing this :

(if (not defined? 'foo) (define foo bar))

without realizing it's not legal scheme.
What would be the idiomatic way to write this ?


Reply via email to