Newsgroups: comp.lang.pop
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!usc!sdd.hp.com!col.hp.com!news.dtc.hp.com!hplextra!hplb!cdollin!kers
From: kers@hplb.hpl.hp.com (Chris Dollin)
Subject: Re: Cancelling ^ and flavours
Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
Message-ID: <KERS.95Jun12171757@cdollin.hpl.hp.com>
In-Reply-To: popx@uk.ac.ox.vax's message of 12 Jun 1995 13:19:41 +0100
Date: Tue, 13 Jun 1995 00:17:57 GMT
References: <3rhbct$653@percy.cs.bham.ac.uk>
Nntp-Posting-Host: cdollin.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Lines: 26

popx@uk.ac.ox.vax (Jocelyn Paine) writes:

   The code fragment below models a situation I found where one of my
   libraries defines ^, but I then need to cancel it so that I can use
   send-to-self in Flavours. I was defining ^ as synonomous in value with
   ** so that I could use 'X is Y^Z' in Prolog.

   Can anyone explain why the following gives a syntax error in the
   definition of f? It complains about ^, but surely the call to syscancel
   has erased any properties this had?

       lib flavours;

       vars ^ = nonop ** ;

       syscancel("^");

       flavour f; defmethod m(); ^m() enddefmethod endflavour;

By cancelling ^, you've removed it from the dictionary; it is now an
undeclared identifier. ``^m'' is illegal syntax, just as ``bill ben''
and ``andy pandy'' are.
--

Regards,    | ``"I can't suit myself," said Weinbaum, a little petulantly.
Kers.       | "I work for the Government".'' - Blish, "The Quincunx of Time".
