Re: n+k patterns, etc.

1993-06-01 Thread hudak-paul


  I think that we should try a different approach, forget about 

  the importing
  mechanism, and make a single statement defining the intended semantics.

  Section 1.2 (The Haskell Kernel) is the place. I propose adding the
  following.

  The translations given, and the identities given for the semantics of
  case expressions, are not macros. A simple replacement of the
  right-hand-side for the left-hand-side with substitution of parameters  
does
  not give the intended semantics. The reason for this is that the
  translations make use of certain names defined in the standard prelude  
(see
  section 5.4), and macro substitution could result in the capture of  
these
  names by locally defined entities, or the use of a name in a context in
  which it is not defined at all because the part of the prelude in which  
it
  is defined has not been imported. The general rule is: the use of a name
  defined in the standard prelude in a translation intended to show the
  semantics of a construct always implies the definition in the standard
  prelude.

  Then, people can locally rebind as much as they want, but the constructs
  defined by translation will be unaffected.
  

This sounds reasonable to me.  -Paul




Multi-Symbol Tokens.

1993-06-01 Thread Steve Tracey



Ken Sailor,

In your mail to the Haskell group, you write:-

 On another level, what about a language that could handle multiple
 symbol tokens (if-then-else, [-], while-do) as well as all the 
 different fixities?  It is available now in OBJ3, but the parsing 
 algorithm is backtracking -- expensive and difficult to predict for 
 certain constructs.  

A paper in SigPlan Notices, vol 17, no 11 - November '82 describes an
algorithm for adding such constructs. It appears to be directly applicable
to Haskell-like languages, though my only experience was in adding it to a
procedural language. It is efficient (non-backtracking), deterministic and
easily added to LL parsers [- perhaps someone should tell the OBJ3
people?].

Ref:-
"Using Simple English Sentences to Call Procedures"
Lindsay J. Groves
SigPlan Notices, 17#11, Nov. 82, pp 31-38.

While looking that up, see also:-
"Naming Subprograms with Clarity"
G. Booch
SigPlan Notices, 17#1, Jan. 82, pp 18-22

[This would open up wondrous possibilities; the present n+k controversy
would pale into insignificance once if-then-else could be rebound :-)]

Regards,
Steve Tracey
-
  Steve Tracey.   Email: [EMAIL PROTECTED]
  GenRad Ltd, Fareham,  Tel:   +44 329 822240 x 181
  Hampshire, UK. P016 8RR   Fax:   +44 329 822305
-