Hello,
and sorry if this is already explained somewhere. I couldn't find anything.
R (2.3.1, Windows) seems to perform some kind of lazy evaluation when
evaluating defaults in function calls that, at least for me, leads to
unexpected results. Consider the following, seemingly equivalent functio
On 9/28/06, Ulrich Keller <[EMAIL PROTECTED]> wrote:
> Hello,
>
> and sorry if this is already explained somewhere. I couldn't find anything.
>
> R (2.3.1, Windows) seems to perform some kind of lazy evaluation when
> evaluating defaults in function calls that, at least for me, leads to
> unexpecte
On Thu, 2006-09-28 at 21:49 +0200, Ulrich Keller wrote:
> Hello,
>
> and sorry if this is already explained somewhere. I couldn't find anything.
>
> R (2.3.1, Windows) seems to perform some kind of lazy evaluation when
> evaluating defaults in function calls that, at least for me, leads to
> un
foo2 could be written:
foo3 <- function(x, y = x) { force(y); x <- 0; y }
to make it clear that evaluation of y is being forced. See ?force
On 9/28/06, Ulrich Keller <[EMAIL PROTECTED]> wrote:
> Hello,
>
> and sorry if this is already explained somewhere. I couldn't find anything.
>
> R (2.3
"Gabor Grothendieck" <[EMAIL PROTECTED]> writes:
> foo2 could be written:
>
>foo3 <- function(x, y = x) { force(y); x <- 0; y }
>
> to make it clear that evaluation of y is being forced. See ?force
And, to answer the specific question: Yes, R has lazy evaluation,
everywhere. Arguments are
>
> And, to answer the specific question: Yes, R has lazy evaluation,
> everywhere. Arguments are always evaluated if and when they are
> needed.
>
But doesn't R has a rather limited force of lazy evaluation? - you
have no control over it, apart from that arguments are evaluated
lazily. This rath
On Thu, 28 Sep 2006, hadley wickham wrote:
>>
>> And, to answer the specific question: Yes, R has lazy evaluation,
>> everywhere. Arguments are always evaluated if and when they are
>> needed.
>>
>
> But doesn't R has a rather limited force of lazy evaluation? - you
> have no control over it, apar
On 9/28/2006 10:34 PM, hadley wickham wrote:
>> And, to answer the specific question: Yes, R has lazy evaluation,
>> everywhere. Arguments are always evaluated if and when they are
>> needed.
>>
>
> But doesn't R has a rather limited force of lazy evaluation? - you
> have no control over it, apart
> > But doesn't R has a rather limited force of lazy evaluation? - you
> > have no control over it, apart from that arguments are evaluated
> > lazily. This rather limited compared to other languages (no lazy
> > lists etc)
>
> You do have more control than that. You can't put a promise in a list
On 9/29/06, hadley wickham <[EMAIL PROTECTED]> wrote:
> > > But doesn't R has a rather limited force of lazy evaluation? - you
> > > have no control over it, apart from that arguments are evaluated
> > > lazily. This rather limited compared to other languages (no lazy
> > > lists etc)
> >
> > You
On 9/29/2006 10:12 AM, hadley wickham wrote:
>> > But doesn't R has a rather limited force of lazy evaluation? - you
>> > have no control over it, apart from that arguments are evaluated
>> > lazily. This rather limited compared to other languages (no lazy
>> > lists etc)
>>
>> You do have more co
On Fri, 29 Sep 2006, Prof Brian Ripley wrote:
> On Thu, 28 Sep 2006, hadley wickham wrote:
>
>>>
>>> And, to answer the specific question: Yes, R has lazy evaluation,
>>> everywhere. Arguments are always evaluated if and when they are
>>> needed.
>>>
>>
>> But doesn't R has a rather limited force
> There are not all that many other languages that use lazy evaluation.
> Those that do are for the most part pure or nearly pure functional
> languages--Haskell is probably the main example. These go much
> further in their use of lazy evaluation than R. For analogs of the R
> expressions
>
>
On Fri, 29 Sep 2006, hadley wickham wrote:
>> There are not all that many other languages that use lazy evaluation.
>> Those that do are for the most part pure or nearly pure functional
>> languages--Haskell is probably the main example. These go much
>> further in their use of lazy evaluation th
14 matches
Mail list logo