🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2525

Re: Complexity of syntax

#2525
From: David Gudeman
Date: Thu, 20 Dec 1990 07:33
24 lines
1493 bytes
In article  <1990Dec19.222059.6878@mathrt0.math.chalmers.se> Lennart Augustsson writes:
]>
]C does not have functions as first class data, you can only use functions
]pointers as data.  To see the difference just try to write a function
]that does function composition.

C does not let you construct functions at run time (which makes the
first-class functions rather anemic) but C does have first class
functions by the usual definition of the term.  The term "first-class"
just means that the type of object in question can be passed as an
argument to procedures and returned from procedures as a result.  In
procedural languages like C, it also means that you can assign the
values to variables.  First-class does not imply any particular
primitive operations on the objects (like construction), and the only
operation that an object needs to make it a function is function
application.

It is not really relevant that the things you pass around are
described in the language documentation as "function pointers".  They
behave exactly like a function.
--
					David Gudeman
gudeman@cs.arizona.edu
noao!arizona!gudeman
Technical Details
Message-ID: <304@coatimundi.cs.arizona.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!noao!arizona!gudeman

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!noao!arizona!gudeman
From: gudeman@cs.arizona.edu (David Gudeman)
Newsgroups: comp.lang.misc
Subject: Re: Complexity of syntax
Message-ID: <304@coatimundi.cs.arizona.edu>
Date: 20 Dec 90 07:33:09 GMT
Sender: news@cs.arizona.edu
Lines: 24