On 11/09/2012 07:30 PM, Allin Cottrell wrote:
> On Fri, 9 Nov 2012, Riccardo (Jack) Lucchetti wrote:
>
>> On Fri, 9 Nov 2012, Allin Cottrell wrote:
>>
>>>
>>> if typeof(whatever) != "scalar"
>>> ...
>>> endif
>>
>> I like this.
I do, too, but why not just use the word 'type'. The "of" part i
On 09/11/12 19:17, Allin Cottrell wrote:
> ... The user-function can, however, be written more
> tersely -- particularly if we take returning NA as sufficient
> indication that the question is invalid:
>
> function scalar iseven (scalar a)
> return a != floor(a) ? NA : a % 2 == 0
> end function
On Fri, 9 Nov 2012, Allin Cottrell wrote:
> I've sometimes wondered if it would be worth trying to expose some sort of
> "enum" system in gretl -- e.g. in this context NONE = 0, SCALAR = 1, SERIES =
> 2 and so on. It would obviously be more intuitive to be able to do
>
> if typeof(whatever) == S
On Fri, 9 Nov 2012, Ignacio Diaz-Emparanza wrote:
> Slightly related (but different) to this question: I needed frequently a
> way to determine whether an integer is even or odd, and I finally wrote
> this function:
>
>
> function scalar iseven(scalar A)
> if (A==floor(A))
> scalar A2
On Fri, 9 Nov 2012, Allin Cottrell wrote:
> On Fri, 9 Nov 2012, Sven Schreiber wrote:
>
>> Am 09.11.2012 18:17, schrieb Allin Cottrell:
>>> On Fri, 9 Nov 2012, Sven Schreiber wrote:
I'm not saying I need it, but it isn't obvious to me why it is less
useful in principle than for exam
Slightly related (but different) to this question: I needed frequently a
way to determine whether an integer is even or odd, and I finally wrote
this function:
function scalar iseven(scalar A)
if (A==floor(A))
scalar A2=floor(A/2)
scalar A2b=A/2
scalar even = (A2
Am 09.11.2012 18:17, schrieb Allin Cottrell:
> On Fri, 9 Nov 2012, Sven Schreiber wrote:
>
>>
>> I'm not saying I need it, but it isn't obvious to me why it is less
>> useful in principle than for example 'isstring()'. Instead it seems to
>> be a natural complement to the other 'is...()' function
Am 09.11.2012 15:30, schrieb Allin Cottrell:
> On Fri, 9 Nov 2012, Pindar wrote:
>
>> The function 'isscalar' seems to be broken (and is only named on p. 148 in
>> the Command Reference).
>
> Yes, it seems to be orphaned (and anyway does not seem to be
> very useful). Let's get rid of it.
>
I'm n
On Fri, 9 Nov 2012, Ignacio Diaz-Emparanza wrote:
> On 09/11/12 19:17, Allin Cottrell wrote:
>> ... The user-function can, however, be written more
>> tersely -- particularly if we take returning NA as sufficient
>> indication that the question is invalid:
>>
>> function scalar iseven (scalar a)
>
On Fri, 9 Nov 2012, Riccardo (Jack) Lucchetti wrote:
> On Fri, 9 Nov 2012, Allin Cottrell wrote:
>
>> On Fri, 9 Nov 2012, Sven Schreiber wrote:
>>
>>> Am 09.11.2012 18:17, schrieb Allin Cottrell:
On Fri, 9 Nov 2012, Sven Schreiber wrote:
>
> I'm not saying I need it, but it isn't ob
On Fri, 9 Nov 2012, Ignacio Diaz-Emparanza wrote:
> Slightly related (but different) to this question: I needed frequently a
> way to determine whether an integer is even or odd, and I finally wrote
> this function:
>
>
> function scalar iseven(scalar A)
> if (A==floor(A))
> scalar A2
On Fri, 9 Nov 2012, Allin Cottrell wrote:
> On Fri, 9 Nov 2012, Sven Schreiber wrote:
>
>> Am 09.11.2012 18:17, schrieb Allin Cottrell:
>>> On Fri, 9 Nov 2012, Sven Schreiber wrote:
I'm not saying I need it, but it isn't obvious to me why it is less
useful in principle than for exa
On Fri, 9 Nov 2012, Sven Schreiber wrote:
> Am 09.11.2012 18:17, schrieb Allin Cottrell:
>> On Fri, 9 Nov 2012, Sven Schreiber wrote:
>>>
>>> I'm not saying I need it, but it isn't obvious to me why it is less
>>> useful in principle than for example 'isstring()'. Instead it seems to
>>> be a natu
On Fri, 9 Nov 2012, Sven Schreiber wrote:
> Am 09.11.2012 15:30, schrieb Allin Cottrell:
>> On Fri, 9 Nov 2012, Pindar wrote:
>>> The function 'isscalar' seems to be broken (and is only named on p. 148 in
>>> the Command Reference).
>>
>> Yes, it seems to be orphaned (and anyway does not seem to b
14 matches
Mail list logo