🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #632

default value specifications

#632
From: Paul Moore
Date: Wed, 12 Dec 1990 12:26
27 lines
1415 bytes
Has anybody proposed a feature to allow more control over the use of
default values in function specifications?

The area I am trying to address is as follows:-

    funca(int i,int j,int k=1, int l=1)

With this syntax is is possible to invoke funca with both k and l not given,
and with l not given, but it is not possible to invoke funca giving l
but not k.

I can imagine several syntaxes that would allow this to be performed

	funca(1,2,,3);
	funca(1,2,*,3);  // or some other character
	funca(1,2, l=3);

The last one is a more fundamental change as it requires knowledge of the
data names used in the function definition. There are some C implementations
that allow the complete use of parameter association by name rather than
position (taken from ADA I think), a discussion of the usefulness of that
construct should not take place here, although it's not an unreasonable
discussion to have.

My preference is for the first construct as it seems the most natural and
does not involve adding any extra meaning to any tokens, or defining new
tokens.
Technical Details
Message-ID: <1990Dec12.122646.13874@hemel.bull.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!pluto.hemel.bull.co.uk!pmoore

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!pluto.hemel.bull.co.uk!pmoore
From: pmoore@hemel.bull.co.uk (Paul Moore)
Newsgroups: comp.std.c++
Subject: default value specifications
Message-ID: <1990Dec12.122646.13874@hemel.bull.co.uk>
Date: 12 Dec 90 12:26:46 GMT
Organization: Bull HN UK
Lines: 27