Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!csd4.csd.uwm.edu!lll-winken!usenet From: usenet@lll-winken.LLNL.GOV (Usenet news admin) Newsgroups: comp.lang.c++ Subject: Re: Named arguments? Message-ID: <30765@lll-winken.LLNL.GOV> Date: 15 Aug 89 23:28:41 GMT References: <612@windy.dsir.govt.nz> <2179@uw-entropy.ms.washington.edu> Reply-To: jac@muslix.UUCP (James Crotinger) Organization: Lawrence Livermore National Laboratory/UC Davis Lines: 33 In article <2179@uw-entropy.ms.washington.edu> adrianb@castor.ms.washington.edu writes: > Also, what about named arguments? > [...] > Interactive statistical packages (like 'S') use > named arguments, e.g. > > z <- scatplot(x, y, scale=3) > > Here `scatplot' could be a function that makes a scatter plot object > from the vectors x and y; it would be sensible to have zillions > of options, > scatplot(x,y,aspect,scale,xtitle,ytitle,xmargin,ymargin,etc..) > the options need sensible defaults of course. > > Is there a better solution?? > From: jac@muslix.llnl.gov (James Crotinger) Path: muslix!jac I've often wondered why C++ default arguments have to obey this silly rule of requiring you specify the leftmost arguments. Either the named argument approach (ala above and...Fortran), or the approach taken by REXX (and probably other languages) where you just use commas to delimit the missing arguments: z = scatplot(x, y,, scale) Is there a good reason that one of these isn't used? >adrianb@castor.ms.washington.edu (until 21 august 1989) Jim