[plt-scheme] immutable list r6rs

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Jan 4 18:59:24 EST 2009

At Sat, 03 Jan 2009 21:16:59 +0100, David Meert wrote:
> I want to know how I can use immutable lists in r6rs.
> This is because [style '(border)] gives the following error:
> initialization for canvas%: expected argument of type <list of style 
> symbols>; given {border}
> my code is below:
> 
> (import (rnrs base (6))
>         (only (scheme base) require))
> 
> (require  scheme/class)
> (require scheme/gui/base)
> 
> (new canvas%
>        [parent vp-left]
>        [style '(border)]
>        [label "playerhimstats"]
>        [min-height 224])
>   )

You can use `mlist->list' from `scheme/mpair':

(require scheme/mpair)
       ....
       [style (mlist->list '(border))]
       .....


Matthew



Posted on the users mailing list.