lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading material?


From: Han-Wen Nienhuys
Subject: Re: reading material?
Date: Sat, 20 Mar 2004 00:55:54 +0100

address@hidden writes:
> > lacks a lot of features that I consider necessary for comfortable
> > programming, like garbage collection, reflection and built-in strings,
> > lists, dictionaries, vectors, and first-class functions.
> > 
> 
> C++ does have built in strings, lists, dictionaries, and vectors.  They are 
> all
> part of the standard template library, and string is used as:

We're going off-topic here, but I'm pretty sure that you know as well
as I that "Hi" and "there" are (char const*). The STL is better than
nothing, but to me a library does not qualify as built-in.

> I'm not exactly sure what you mean by first-class function, but if you mean
> functors, or function objects (an object that is a function - better than a
> function pointer), C++ has those, too.

First-class means first-class citizens, that is, objects of that type
can be used in all language constructs just like other objects.  For
example, a function that returns a function in Scheme is natural,

 (define (iterate func k)
   "Produce the function x -> FUNC(FUNC .. (x) .. ) "
   (if (> k 0)
       (lambda (x) (func ((iterate func (1- k)) x)))
       (lambda (x) x)))

 (define to-6th-power (iterate sqr 3))

If you're suitably masochistic, then you could come up with a C++
solution, but I doubt it would be natural or elegant. Besides, I don't
appreciate masochism when it comes to programming.

> I'm not exactly sure what you mean by reflection, so I cannot comment.  As far
> as size, yes it's large, but I believe there are compiler settings to reduce 
> the
> size by dropping some unnecessary libraries (like error handling).

I'm not referring to code size.

Quality of software is measured by its simplicity, and the 2000-page
thick C++ standard is a bad omen in this regard.

--
 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]