🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3206

Re: CHALLENGE: heterogeneous collections

#3206
From: Dan Bernstein
Date: Tue, 26 Mar 1991 23:28
12 lines
1055 bytes
In article <48805@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes:
> Hmm...  How about a window with a hetrogeneous collection of buttons, sliders,
> text displays, etc, all of which respond to "redraw" and "is the mouse
> over you"?

struct { any object; void (*redraw)(); int (*ismouseover)(); } *whatsinwindow();

Here ``any'' is a polymorphic type (e.g., void * in C), and *redraw
takes an ``any'' argument. Naturally, languages like C++ encapsulate the
above struct into a single ``class,'' but that's merely syntactic sugar.

---Dan
Technical Details
Message-ID: <7689:Mar2623:28:5091@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <1991Mar22.210725.29448@neon.Stanford.EDU> <pallas.669923769@red-dwarf> <48805@nigel.ee.udel.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!swrinde!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.lang.misc
Subject: Re: CHALLENGE: heterogeneous collections
Message-ID: <7689:Mar2623:28:5091@kramden.acf.nyu.edu>
Date: 26 Mar 91 23:28:50 GMT
References: <1991Mar22.210725.29448@neon.Stanford.EDU> <pallas.669923769@red-dwarf> <48805@nigel.ee.udel.edu>
Organization: IR
Lines: 12