[plt-scheme] 3.99: lazy + match ?
On May 26, Jon Rafkind wrote:
> I am trying to use match and the lazy language together but they
> don't seem to be cooperating. Should this work?
No, not without some explicit efforts that integrate `match' into the
lazy language. The easy solution would be to do that by forcing the
matched value, but a proper solution will force just the part that is
needed for the match but not more. [You can usually get such magic to
happen by re-evaluating the library in the lazy language -- but
`match' is big enough that it won't work in this case.]
> #lang lazy
> (require scheme/match)
>
> (define-struct f (x))
>
> (printf "test1 ~a\n"
> (match (make-f 1)
> ((struct f (x)) 'ok)))
>
> >
> match: no matching clause for #<promise:temp4>
>
> === context ===
> /home/kazzmir/svn/plt/trunk/collects/scheme/match/patterns.ss:17:0:
> match:error
>
> It works fine in #lang scheme. I'm running from svn, r9936( mzscheme
> v3.99.0.25 ).
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!