[racket] ->i contract question
Turning things back and forth between values and lists is not
something that our apis and our runtime infrastructure really
encourages. So I'd say that the first thing to try would be to either
fix the number of values returned from the function or to start
programming with lists instead.
If that doesn't work, then it is certainly possible to make function
contract combinators that implicitly do the call-with-values like that
and then list you specify the range contract kind of like how you
specify the #:rest contract. I'd be happy to help guide someone who
wanted to try to use the contract library to attempt that. It would be
a good exercise to learn about contracts and macros, no doubt!
Robby
On Mon, Sep 22, 2014 at 8:14 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> As far as I can tell, there is no contract form that allows treating
> the values returned as a list. Here is how you could implement one if
> you wanted:
>
> http://pasterack.org/pastes/46111
>
> Maybe Robby has an opinion about whether this should be done in racket/contract
>
> Jay
>
> On Sun, Sep 21, 2014 at 1:47 AM, Kevin Forchione <lysseus at gmail.com> wrote:
>> Hi guys,
>> Is there a syntax for dependent-range that would allow 0 or more values to be specified? The documentation appears to describe only a specified number of values. Is there an analogue to list of and non-empty-listof?
>>
>> -Kevin
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>
>
>
> --
> Jay McCarthy
> http://jeapostrophe.github.io
>
> "Wherefore, be not weary in well-doing,
> for ye are laying the foundation of a great work.
> And out of small things proceedeth that which is great."
> - D&C 64:33
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users