oldk1331 wrote:
> 
> On Fri, Nov 16, 2018 at 10:07 PM Waldek Hebisch
> <[email protected]> wrote:
> >
> > That is the point: normal case is that we check before using
> > 'children' and error in 'childern' is to catch bugs
> > (missing check).  That is why I ask if you have use
> > case when we want call without check and empty return is
> > OK.
> 
> That makes sense, I'll make changes to code and documentation
> accordingly.
> 
> One reason I didn't mention is that, "rest" doesn't give error when
> argument is empty list, I was influenced by that.  What's your
> opinion on this function?

'rest' is performance critical, and without checking can be done
by single machine instruction so in many cases we want non-checking
version for performance.  I am not sure if default version of 
'rest' should be checking -- given that change would be quite
large (we would have to put fast version in all places which
need speed) I tend to keep current situation.

OTOH 'first' must check for type correctness and we have check
here.

> (BTW, in Scheme "(cdr '())" gives error while in Common Lisp
> it gives NIL.)

Common Lisp uses low-level hack to so that '(CAR NIL)' and
'(CDR NIL)' again give 'NIL' without any checks.  There
are some Lisp idioms that work only due to such definitions.
In typed system balance is different.


-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to