guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: design advice on predicate name


From: Marco Maggi
Subject: Re: design advice on predicate name
Date: Fri, 18 Aug 2006 21:01:54 +0200

"Neil Jerram" wrote:
>"Marco Maggi" <address@hidden> writes:
>>   Example: I have two predicates HIT-NAN? and MAP-NAN?
>> which one it is better to call NAN?
>
>I'm afraid I don't understand.  Perhaps you could write
>the down for the two possibilities that you have in mind.

For a vector of real numbers like this [1 +nan.0 3]:

* hit-nan? returns #t because at least one element
  is nan;

* map-nan? returns #(#f #t #f), one boolean for each
  element;

the same for matrices. map-nan? works like the 'isnan'
function of GNU Octave, which for the example vector
would return [0 1 0].

  hit-nan? can be used in the conditional of IF and
COND, while map-nan? must be inspected. For this reason
I guess that hit-nan? should be the nan?, but, to the
best of my knowledge, GNU Octave defines only the map-nan?
equivalent so I do not know how useful can be hit-nan?
in practice.



--
Marco Maggi

"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]