[gambit-list] Promises & lazy thunks
Marc Feeley
feeley at iro.umontreal.ca
Tue Apr 30 10:46:48 EDT 2013
On 2013-04-29, at 5:12 PM, Bradley Lucier <lucier at math.purdue.edu> wrote:
>
> On Apr 29, 2013, at 4:31 PM, Jason Felice wrote:
>
>>
>> On Mon, Apr 29, 2013 at 4:13 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:
>>
>> Primitives like "cons" and "list" should not force their arguments because they are not strict (i.e. they don't need to know the value of the arguments).
>>
>> It isn't clear if type predicates are strict or not. I can see arguments both ways.
>>
>> Hmm, I can't think of a reason to make them lazy. What's the thought?
>
> Well, if you'd like to see whether something is a promise or a fixnum, you'd have to call (promise? x) first if (fixnum? x) always forces its argument.
>
> I've been thinking about this a bit, I'm not going to use the auto-force Gambit, but perhaps the type predicates should be made consistent.
I agree with the consistency argument. So now fixnum? and flonum? auto force their argument like all other type predicates (except ##promise?). Please let me know if you find other cases.
Marc
More information about the Gambit-list
mailing list