You can simulate and ->im with ->i by adding a mandatory (first) argument
with contract any/c.
Robby
On Sat, Aug 31, 2013 at 6:39 AM, Diego Sevilla Ruiz wrote:
> Hi all:
>
> I have encountered a situation in which I don't know how to
> specify the contract for a method that:
>
> 1. Has
Hi, Matthias:
Yes, you're right about the "sum" types of the domain and range of
functions. A small remark below (just to clarify myself too...)
On 31/08/13 20:36, Matthias Felleisen wrote:
On Aug 31, 2013, at 2:19 PM, Diego Sevilla Ruiz wrote:
The example you give for C, you're right, it
On Aug 31, 2013, at 2:19 PM, Diego Sevilla Ruiz wrote:
> The example you give for C, you're right, it is not appropriate for C because
> C has a (lax) static type system.
Let's call it what it is: unsound. Let's also agree that C's type system is so
impoverished that it is simply useless to ta
Hi, Greg:
On 31/08/13 17:16, Greg Hendershott wrote:
If I knew the answer I'd tell you, and hopefully someone else will.
Meanwhile, another way you could look at this: If it becomes too
difficult to write a contract (or documentation) for a function, it
might be good to revise the function.
Fo
Ah, Matthew, thank you. Exactly what I need. I had the impression that I
could use these, but I couldn't find examples in the documentation.
Best regards,
diego.
On 31/08/13 17:53, Matthew Flatt wrote:
I think want `case->`:
(define/contract get-whatever (case->
I think want `case->`:
(define/contract get-whatever (case->
(-> (vectorof integer?))
(-> exact-nonnegative-integer? integer?))
(lambda ([pos #f])
(if (not pos)
inner-vector-of-int
(vector-ref inner-vector-o
If I knew the answer I'd tell you, and hopefully someone else will.
Meanwhile, another way you could look at this: If it becomes too
difficult to write a contract (or documentation) for a function, it
might be good to revise the function.
For example, a function that takes an optional argument th
Hi all:
I have encountered a situation in which I don't know how to specify the
contract for a method that:
1. Has a final optional argument
2. The value of the optional argument makes the method change the return
type of the method.
It is similar to this:
(define/public (get-whatever (po
8 matches
Mail list logo