From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,24ac4e1c8cbfe3c X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: histrionics Date: 1999/09/14 Message-ID: <37DECE9D.72D1E87E@mitre.org>#1/1 X-Deja-AN: 525170428 Content-Transfer-Encoding: 7bit References: <37D670CE.855F96BD@interact.net.au> <37D678E4.9867000B@interact.net.au> <37d74de9@eeyore.callnetuk.com> <7r8c60$b2q$1@nnrp1.deja.com> <7r9rkj$g75$1@nnrp1.deja.com> <7rcddd$bfd$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 937348499 12397 129.83.41.77 (14 Sep 1999 22:34:59 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 14 Sep 1999 22:34:59 GMT Newsgroups: comp.lang.ada Date: 1999-09-14T22:34:59+00:00 List-Id: Robert Dewar wrote: > No, again I disagree, the power of very high level languages > is directly related to the fact that you want to be able > to describe things at a much higher level, and of course > the descriptions are shorter. If I can say (this is SETL, > without the nice character set :-) > > primes = {n in 2 .. 100 | > notexists j in 2 .. n - 1 | > n mod j = 0}; > > that's a WHOLE lot easier to understand than a seive programmed > in a conventional procedural language. Vladimir, you can supply > the corresponding prolog program if you like :-) I prefer the > statement in SETL, since it seems close to the mathematical > definition of primes, both syntactically and semantically I agree, I prefer APL for this kind of thinking even though there is the problem that you really need to rewrite the "program" in a readable language once you have it correct. For example, I know of three short definitions (taking 18, 17 and 16 characters respectively) for primes. The longest--but most efficient, defines a prime as an integer with exactly two positive integer divisors. The next definition is that a prime is an integer that is not a member of the set of products of all the integers greater than one. The shortest definition corresponds to Wilson's theorem: An integer N is prime iff (N-1)! is congruent to -1 mod N. Note that none of these is the algorithm I would use to find out whether or not a large integer is prime, but even those algorithms are easier to think about in a higher level notation that supports number theory well. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...