X-Comment1: #############################################################
X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
X-Comment3: # If this address does not work please ask your mail #
X-Comment4: # administrator to update your NRS & mailer tables. #
X-Comment5: #############################################################
This is certainly technically feasible. As it happens, our compiler is set
up so that it is easy to compile any pattern which you can express as a
predicate function ("does it match?") plus an extract-binder function ("tell
me the value of n, given the value of the arg").
The remaining issue is the usual judgement of language complexity vs
expressiveness. Myself, I like it.
Simon
| From: Tony Davie <[EMAIL PROTECTED]>
| Date: Wed, 30 Oct 91 17:04:28 GMT
|
|
| It seems to me that some of the most useful arithmetic divide and
| conquer algorithms express a function of an integer n in terms of
| the same function applied to n `div` 2. Has any thought been given to
| generalising n+k patterns to c*n+k patterns? If these were allowed we
| would be able to express, for instance, the well known algorithm for
| raising numbers to an integer power by:
|
| x^0 = 1
| x^(2*n) = xn*xn where xn = x^n
| x^(2*n+1) = x * x^(2*n)