[plt-scheme] typed scheme mutation & "style" question
Perhaps you want for-each instead of map? Then your return type will
be just Void.
HTH,
N.
On Wed, Apr 14, 2010 at 8:40 PM, keydana at gmx.de <keydana at gmx.de> wrote:
> Hi,
>
> I have difficulties with using mutator code in typed scheme (in getting the typing right & "nice").
>
> For example, I have a function
>
> (: replace-attnames ((Listof (Pair Attribute String)) (Listof Attribute) -> (Listof (Listof Void))))
> (define replace-attnames
> (lambda (renamings attrs)
> (map (lambda: ((mapping : (Pair Attribute String))) (map (lambda: ((a : Attribute)) (set-Attribute-name! a (cdr mapping))) (filter (lambda: ((att : Attribute)) (attribute=? att (car mapping))) attrs))) renamings)))
>
...
>
> Many thanks in advance for your advice,
> Sigrid_________________________________________________