From ... From: Erik Naggum Subject: Re: [Q]: Recursion help Date: 2000/01/23 Message-ID: <3157638303325956@naggum.no>#1/1 X-Deja-AN: 576564090 References: <5ijj8s81rcin4hbjdluphtovcoveu50gh7@4ax.com> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 948649500 3578 195.0.192.66 (23 Jan 2000 17:45:00 GMT) Organization: Naggum Software; +47 8800 8879 or +1 510 435 8604; fax: +47 2210 9077; http://www.naggum.no User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 23 Jan 2000 17:45:00 GMT Newsgroups: comp.lang.lisp * Dirt | So, it is safe to recommend to my professor that we should be taught | to use '=' to compare numbers rather than 'eq'? your professor should never teach EQ in the first place. EQ should be discovered by good students on their own. novices should always use EQL for typeless object comparison, and try not to think about EQ. = signals an error for non-numbers. this is often a major pain. EQL yields false if the objects are of different types. this can sometimes be exactly what you want. = yields true for _numeric_ equality, which can sometimes be very expensive to compute, but is often worth the cost, except when you control the types of both objects and you would have to be a real klutz to introduce that cost wantonly. therefore, EQL will tell you about suboptimal programming practices if it yields false on two numbers that appear "alike", and this fact alone will teach most students better programming practices. #:Erik