🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9236

Re: by-ref parameters, aggregate co

#9236
From: karl
Date: Wed, 03 Sep 1986 19:45
15 lines
1301 bytes
umcp-cs!chris (Chris Torek) writes:
>> 	foo(c) char &c; { ...
>I have no great love for this syntax either; but how else do you
>propose to add by-reference parameters?

Since you asked.  I once suggested "foo(&c) char c; { ... }"; this makes the
declaration in the callee match the syntax in the caller.  However, I have
since decided that the more general reference objects a la C++ are better,
since it allows you to write "lfunctions" that can be used on the left side
of an assignment (e.g. "x = pop(); ...; push() = x").  But as I mentioned in
another posting, "char *&c" is more consistent than "char &c" to declare a
reference.  (And it's probably better than adding a new keyword.)

Karl W. Z. Heuer (ima!haddock!karl; karl@haddock.isc.com), The Walking Lint
Technical Details
Message-ID: <86900039@haddock>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
References: <3100@umcp-cs.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
From: karl@haddock
Newsgroups: net.lang.c
Subject: Re: by-ref parameters, aggregate co
Message-ID: <86900039@haddock>
Date: Wed, 3-Sep-86 15:45:00 EDT
Article-I.D.: haddock.86900039
Posted: Wed Sep  3 15:45:00 1986
Date-Received: Wed, 3-Sep-86 21:56:08 EDT
References: <3100@umcp-cs.UUCP>
Lines: 15
Nf-ID: #R:umcp-cs.UUCP:3100:haddock:86900039:000:768
Nf-From: haddock!karl    Sep  3 15:45:00 1986