From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!news-feed.ifi.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: macros vs HOFs (was: O'Caml) Date: 12 Sep 2002 21:51:02 +0000 Organization: Naggum Software, Oslo, Norway Lines: 32 Message-ID: <3240856262261155@naggum.no> References: <3D7CB8DF.8050108@pontos.net> <3240690993463545@naggum.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: maud.ifi.uio.no 1031867463 13898 129.240.64.16 (12 Sep 2002 21:51:03 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 12 Sep 2002 21:51:03 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:40518 * Gareth McCaughan | I agree that static typing doesn't cause the problem. (That was my point.) I think my point has been muddled. When I said that this (/ int int) -> int is /a consequence of/ static typing, that does not mean that it is not also a consequence of more factors. It means that if you choose static typing, you will also make this kind of design choice. In particular, if you choose types that are close to the machine, (/ int int) -> int is the obvious choice because the hardware that you have chosen to model does precisely that. If, however, you think in mathematical terms, you do not have (/ int int) to begin with, you have (/ number number), and the result is of type number, but this would not aid efficiency at all! Since better efficiency is a goal of the application of most type theories, a type systems that do not consider all (numeric) types disjoint are basically worthless. * Ray Blaak | (truncate (/ x y)) * Gareth McCaughan | Of course. Pardon me, but (truncate (/ x y)) is stupid when (truncate x y) expresses the operation better and even returns the two values that machine division instructions routinely produce instead of having to compute a new, second return value. Note the alternatives `floor´, `ceiling´, and `round´, as well. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.