Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!killer!tness7!bellcore!color!kurt
From: kurt@color.ctt.bellcore.com (Kurt Gluck(PICS))
Newsgroups: comp.lang.c++
Subject: Re: User defined operators
Message-ID: <7291@bellcore.bellcore.com>
Date: 10 May 88 21:56:22 GMT
References: <1206@its63b.ed.ac.uk> <6590048@hplsla.HP.COM>
Sender: news@bellcore.bellcore.com
Reply-To: kurt@color.UUCP (Kurt Gluck(PICS))
Organization: Planning and Engineering Systems Lab, Bellcore
Lines: 42


How about going with snobols method.  Predefine a small number of
additional unused operator symbols that can be used.

In snobols case the operator symbols are:

BINARY OPERATORS
Graphic	Defnition		    Associativity	    Precedence
=======	==========================  =============	    ==========
    ~	UNUSED			    right		    12
    ?	UNUSED			    left		    12
    $	immediate value assignment  left		    11
    .	conditional value assignment left		    11
    !	exponentiation		    right		    10
    **	exponentiation		    right		    10
    %	UNUSED			    left		    9
    *	multiplication		    left		    8
    /	division		    left		    7
    #	UNUSED			    left		    6
    +	addition		    left		    5
    -	subtraction		    left		    5
    @	UNUSED			    left		    4
 blank	concatenation		    left		    3
    |	alternation		    left		    2
    &	UNUSED			    left		    1

UNARY OPERATORS
graphic	definition
=======	==========
    ~	negation
    ?	interrogation
    $	indirect reference
    .	name
    !	UNUSED
    %	UNUSED
    *	unevaluated expression
    /	UNUSED
    #	UNUSED
    +	positive
    -	negative
    @	cursor position
    |	UNUSED
    &	keyword