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

Re: weird bug (& implementing monad transformers with units)



Quoting Daniel Mahler:
> Welcome to DrScheme, version 103.
> Language: Graphical Full Scheme (MrEd).
> internal-syntax-error: compound-unit: duplicate external name at: amb
> in: (#%compound-unit (import) (link (n ((#%with-continuation-mark
> (#%quote debug-key-127) #<struct:zodiac> ((#%with-continuation-mark
> (#%quote debug-key-127) #<struct:zodiac> #%unit-with-signature-unit)
> n)) (l amb) (l bind) (l const) (l fmap) (l join)...

The error message should have been something like the one MzScheme
reports:

 compound-unit/sig: the name "amb" is exported twice in:
 (compound-unit/sig (import) (link (n : ((open amb^) (open
 interp-pub^)) (interp-transform@ l)) (l : amb^ (list@))) (export (open
 n) (open l)))

In list-interp@, both interp-transform@ and list@ supply `amb' (and
other things), so list-interp@ can't export all variables from both
without distinguishing them somehow, either through `unit' exports or
with prefixes.


DrScheme's implementation of `compound-unit/sig' apparently doesn't
check for duplicate variables, and the problem is discovered later,
when it isn't expected -- hence the "internal" error.

This bug is fixed for the next version of DrScheme, mainly because
there's just one implementation of `compound-unit/sig' that is used by
both MzScheme and DrScheme.

Matthew