proposed ` and $ operators

Graham Ross grahamr at bronze.UUCP
Fri Aug 19 08:17:44 AEST 1983


The array-as-lvalue operator and the string concatenation operator seem
like poor ways to spend two of the three remaining printable ASCII
characters.

You can implement something like the ` operator with a "routine" that
gets turned into a block move instruction by a sed script.  The macro
adds a little sugar.  Here are the VAX versions:
--------
#define acopy(dst,src) _movc5(sizeof(src),(src),sizeof(dst),(dst))
#define ncopy(dst,src,len) _movc3((len),(src),(dst))
--------
s/calls	$2,__movc5/movc5	(sp),*4(sp),$0,8(sp),*12(sp)\
	addl2	$16,sp/
s/calls	$2,__movc3/movc3	(sp),*4(sp),*8(sp)\
	addl2	$12,sp/
--------

I can't help but think that C is not the best language for all this
string and array processing.  If the block move stuff is all that's
needed, maybe a preprocessor is a reasonable way to get it.  If what
you really want is a fancier language, a better choice -- and one that
C programmers often find palatable -- might be Icon.  It offers many
other features on top of rich string processing.  Here's an excerpt
from the Icon newsletter:

	Send your name, address, telephone number, electronic mail
	address, telex address and EITHER a >=1200' tape OR a $15 check
	payable to U of Ariz. to:

	Ralph E. Griswold
	Dept. of Comp. Sci.
	University Computer Center
	University of Arizona
	Tucson, AZ	85721
			USA

	You're supposed to request V5 Icon for VAX/Unix.  It comes in
	tar format.  You have to request 800 or 1600 bpi.
	They also post a net address:
		ucbvax!arizona!icon-project
		icon-project.arizona at rand-relay

-Graham Ross
teklabs!tekmdp!grahamr



More information about the Comp.lang.c mailing list