[plt-scheme] Whole module contracted signature

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Sun Jun 14 20:33:43 EDT 2009

On Sun, 2009-06-14 at 20:11 -0400, Matthias Felleisen wrote:
> Can you make an example of what you would like?
> 

It's really not a huge issue... but in the guide:
http://docs.plt-scheme.org/guide/Whole-module_Signatures_and_Units.html

it is shown:
#lang scheme/signature
  
  build-toys  ; (integer? -> (listof toy?))
  repaint     ; (toy? symbol? -> toy?)
  toy?        ; (any/c -> boolean?)
  toy-color   ; (toy? -> symbol?)

This uses up a module to define a signature by allowing me not to type
define-signature.

When it comes to contracted signatures:
http://docs.plt-scheme.org/guide/Contracts_for_Units.html

It shows:
#lang scheme
    
(define-signature contracted-toy-factory^
    ((contracted
      [build-toys (-> integer? (listof toy?))]
      [repaint    (-> toy? symbol? toy?)]
      [toy?       (-> any/c boolean?)]
      [toy-color  (-> toy? symbol?)])))

    (provide contracted-toy-factory^)

This defines a contracted signature over a single module. I asked if it
was possible to define a contracted signature but with the same 'help'
provided by whole-module signatures. Maybe something like (note: i made
up the following syntax):

#lang scheme/signature/contracted

build-toys (-> integer? (listof toy?))
repaint    (-> toy? symbol? toy?)
toy?       (-> any/c boolean?)
toy-color  (-> toy? symbol?)

Cheers,

Paulo Matos

> 
> On Jun 14, 2009, at 8:07 PM, Paulo J. Matos wrote:
> 
> > On Sun, 2009-06-14 at 16:20 -0400, Matthias Felleisen wrote:
> >> If you mean unit signatures, the answer is yes. See docs. -- Matthias
> >>
> >>
> >
> > I can find whole-module signatures and units. I can find how to  
> > attach a
> > contract to units and signatures but not how to define whole-module
> > signatures and units.
> >
> >> On Jun 14, 2009, at 4:09 PM, Paulo J. Matos wrote:
> >>
> >>> Hi,
> >>>
> >>> Given that there is a way to define whole-module signatures, is
> >>> there a
> >>> similar way for contracted signatures?
> >>>
> >>> Cheers,
> >>>
> >>> Paulo Matos
> >>>
> >>> _________________________________________________
> >>>   For list-related administrative tasks:
> >>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >>
> >
> 



Posted on the users mailing list.