guile-devel
[Top][All Lists]
Advanced

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

contract-out


From: Stefan Israelsson Tampe
Subject: contract-out
Date: Sun, 18 Mar 2012 16:41:21 +0100

Hi,

I have an ideom that I wouldlike to model more clenaly. currently in guile-contract you
do


(contract-out-spec spec (f (-> symbol? symbol?)))

....
(define (f x) x)
...

(contract-out spec)


This way we f will be exported using the contract (-> symbol? symbol?) e.g. it has to accept a symbol and return a symbol
or else an error is thrown. But and f will be untouched internally. This is a bit hacky, I would like to have 1 form, eg. contract-out
 like in racket meaning that one at the first form could add code to be executed after the rest of the document have been parsed.
Is this possible?

/Regards
Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]