🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3360

Re: The search for heterogeneous lists is still on!

#3360
From: Darren New
Date: Thu, 04 Apr 1991 01:04
33 lines
2309 bytes
In article <10977:Apr319:27:2891@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>In article <49591@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes:
>> To say that printf does not have a
>> hetrogeneous list of arguments but rather a list of unions kind of begs
>> the question.
>
>No, it doesn't. Because varargs are a poorly defined hack, printf cannot
>in practice typecheck its arguments, but the arguments are nevertheless
>constrained to come from one of several types---{int,long,float,double,
>ptr-to-char}, for example.

I was taking "union" to mean "C union" rather than what you imply
here.  Also, I submit for consideration that varargs is a poorly
defined hack due to the inherent lack of ability to manipulate "true"
hetrogeneous lists in C.  (Actually, varargs seems like a *well*
defined hack compared to some of the other library routines.  The
implementation usually sucks. :-) If C could implement *real*
hetrogeneous lists, the varargs "hack" would be neither poorly defined
nor a hack.

>A function taking a heterogeneous argument can be given types not
>specifically anticipated by the function writer. This is a necessary,
>though not sufficient, restriction, which still eliminates printf.

OK.  I was using a definition for "hetrogeneous" meaning "having different
types" rather than "having different types and which the function writer
didn't know about".  I'll use your definition from now on.

-- 
--- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
----- Network Protocols, Graphics, Programming Languages, FDTs -----
  +=+=+ My time is very valuable, but unfortunately only to me +=+=+
+ When you drive screws with a hammer, screwdrivers are unrecognisable +
Technical Details
Message-ID: <49732@nigel.ee.udel.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!ee.udel.edu
References: <167:Mar3121:32:0891@kramden.acf.nyu.edu> <49591@nigel.ee.udel.edu> <10977:Apr319:27:2891@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!ee.udel.edu
From: new@ee.udel.edu (Darren New)
Newsgroups: comp.lang.misc
Subject: Re: The search for heterogeneous lists is still on!
Message-ID: <49732@nigel.ee.udel.edu>
Date: 4 Apr 91 01:04:04 GMT
References: <167:Mar3121:32:0891@kramden.acf.nyu.edu> <49591@nigel.ee.udel.edu> <10977:Apr319:27:2891@kramden.acf.nyu.edu>
Sender: usenet@ee.udel.edu
Organization: University of Delaware
Lines: 33
Nntp-Posting-Host: nigel.ee.udel.edu