On Fri, Dec 28, 2012 at 9:42 AM, Matthias Felleisen
wrote:
> 2. We see Racket as a continuum:
...
>, you should know which entry point is best for you
> and choose for yourself at which level you wish to enter. The
> point is
>
> with Racket, you have this choice
>
> (and with other languages,
An alternate flow which I think aligns slightly better with graduated code
validity vs cost (effort)?
0. Quick and dirty code spikes, snippets in R.
1. Write prototype code directly in TR.
- Liberal addition via Step 0 efforts, pre and current with Step 1.
- TR is very lightweight.
- The sin
On Dec 27, 2012, at 8:58 PM, Harry Spier wrote:
> On Fri, Dec 14, 2012 at 10:44 AM, Matthias Felleisen
> wrote:
>>
>> It is critical to inform clients of the services that a module
>> provides. In the absence of types, contracts are the closest
>> information we have.
> AND
> On Fri, Dec 14, 20
On Fri, Dec 14, 2012 at 10:44 AM, Matthias Felleisen
wrote:
>
> It is critical to inform clients of the services that a module
> provides. In the absence of types, contracts are the closest
> information we have.
AND
On Fri, Dec 14, 2012 at 11:43 AM, Ray Racine wrote:
> For the TR folks you can h
I have clarified the interface specification part of the Style guide.
The original draft was written before contract-out existed. I have
rewritten all provide/contracts into provide plus contract-out.
Having said that, I absolutely,
On Fri, Dec 14, 2012 at 10:44 AM, Matthias Felleisen
wrote:
>
> So, if you want to be good, put provide contract-out at the top
> of your module.
How about having a link on the Racket webpage to the Style Guide for
this and other style issues?
Harry Spier
_
Racket Devel
What Ryan describes is what I was asking for but I now see what
Matthias's saying, that the contract information belongs in the
interface at the top of the module.
The Racket Guide section on contracts starts out with provide
(contract/out . . . at the start of the module but from section 7.3.2
The `plot' library uses `unstable/latent-contract' to do exactly that.
Example: the identity function restricted to `integer?' values:
#lang racket
(module internal-provider racket
(require unstable/latent-contract/defthing)
(provide int-id int-id:doc) ; export doc generator too
(defpro
Thou shall not copy code.
You should
(define-type i2i (Integer -> Integer))
so that you don't have to repeat the type.
On Dec 14, 2012, at 11:43 AM, Ray Racine wrote:
> For the TR folks you can have your cake and eat it with a cup of coffee with
> `provide'. TR Rules
>
> #lang typed/
That is precisely how I understood the contract.
And that is precisely why I wrote down why I object.
On Dec 14, 2012, at 11:55 AM, Ryan Culpepper wrote:
> I understood the feature request differently. I take it as wanting to write a
> module like the following:
>
> #lang racket
> (provide
I understood the feature request differently. I take it as wanting to
write a module like the following:
#lang racket
(provide
(with-declared-contracts-out
f
g))
(declare-contract f )
(define f )
(declare-contract g )
(define g )
That is, the contracts themselves are
For the TR folks you can have your cake and eat it with a cup of coffee
with `provide'. TR Rules
#lang typed/racket/base
;;public interface/w specifications
(provide:
[inc (Integer -> Integer)])
...
(: inc (Integer -> Integer))
(define (inc x) (add1 x))
...
On Fri, Dec 14, 2012 at 10:44
Matthias has vastly more experience and perspective in matters like
this; you would be wise to prefer his advice.
But if I understand correctly what you want, I think you could do this
yourself with a simple macro:
(define-syntax define/contract/provide
(syntax-rules ()
[(_ (id . args) cont
It is critical to inform clients of the services that a module
provides. In the absence of types, contracts are the closest
information we have. Reading the implementation is against
all good SE ideas.
IF we could assume that people always programmed in DrRacket,
we could compromise and add a
If you place provide/contract at the beginning of a module it makes
the interface clear but it is separated from its function. If you
place it right before its function and not at the top of the module,
it makes the function clearer but the module interface is not so
clear.
Is it possible (would
15 matches
Mail list logo