From: Michael Wojcik on
Brian Boutel wrote:
> Michael Wojcik wrote:
>>
>> If we relax the definition to allow named as well as anonymous
>> functions, then someone could argue that get-accessors for properties
>> are thunks, and those are quite common in modern languages.
>
> In functional languages with lazy evaluation (e.g. Haskell) arguments
> are passed unevaluated, so an actual argument that is an expression
> needs to be parcelled up as a piece of code and an environment in which
> is is to be evaluated (i.e the bindings of the free variables in the
> code). This amounts to a thunk.

Good point. I have a passing familiarity with lazy evaluation, but
even with functional programming most of my experience is with
eager-evaluating languages like OCaml, so I didn't think of this example.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University
From: Greg Menke on
Michael Wojcik <mwojcik(a)newsguy.com> writes:


> Greg Menke wrote:
>>
>> C++ does make for a nice "type-safe linking" C compiler.
>
> Except that it's not a C implementation, and so is not a C compiler at
> all.
>
> C and C++ are different languages.

Perhaps so, yet it is possible to compile C programs with a C++ and
observe some benefits relating to better compile-time and link-time type
checking. One can then disassemble the object modules created by C vs
C++ compilers and observe the distinct similarity of with respect to the
runtime structure.

Which is why it "makes for a nice C compiler", not "is a better C
compiler".

Gregm
From: Greg Menke on
Michael Wojcik <mwojcik(a)newsguy.com> writes:

> Greg Menke wrote:
>> Peter Flass <Peter_Flass(a)Yahoo.com> writes:
>>
>>> C is a collection of ad-hoc ideas. WG14 may have put a great deal of
>>> thought into how to extend it without breaking the existing mosh, but
>>> that's my point, it's still a mosh.
>>
>> iostream formatting operators, because we really need more operator
>> overloading and no enhancements are too bizarre in service of making
>> everything, (for particular values of everything), specialized?
>
> How fortunate, then, that C does not have them.

You are quoting out of context.

The original topic to which I followed up via the above quote was
related to the sometimes "undesigned" appearance of C++. The particular
quote above suggests C was already a collection of ad-hoc ideas, so that
C++ is not a substantial departure from existing practice.


>> Oh but wait, you can compile, install and dig your way through Boost so
>> as to avoid the fun & games of vanilla iostream.
>
> Not in C, you can't.

See above.

>
>> Thank goodness printf and friends are still around.
>
> Indeed, since a great number of C programs use them, and the committee
> is explicitly charged with maintaining upward compatibility from the
> first standard.

See above.

Gregm
From: Gene Wirchenko on
On Sat, 06 Mar 2010 18:55:56 -0600, Charles Richmond
<frizzle(a)tx.rr.com> wrote:

[snip]

>I think there is *not* a single C programmer who has *not* had his
>hand slapped by making the mistake of using "=" when he meant
>"==". Thus the avalanche of replies... :-)

And because of this stupidity in language design being taken as
acceptable, now, there is, in some related languages, the problem of
using == when you needed ===.

Sincerely,

Gene Wirchenko
From: Andy Botterill on
Could you please move this discussion about C and related programming
languages out of comp.arch.fpga. This thread has deviated considerably
from the original posters request which was mostly on topic. Andy