Creating anonymous functions?

Started by
14 comments, last by eighty 20 years, 9 months ago
quote:Original post by Anonymous Poster
Check out Boost Lambda (http://www.boost.org). It's fairly limited and not nearly as flexible as lambda constructs in (mostly) functional languages, but if your needs are simple, it might be what you're after.

Interesting... I'll check it out.

quote:
Gcc does, but not g++, AFAIK. It only works as an extension to the C language.

Hm... I was under the impression gcc == g++...?

Thanks for the replies.

[edited by - eighty on July 9, 2003 2:38:38 AM]
Advertisement
quote:Original post by eighty
Hm... I was under the impression gcc == g++...?


Most (all?) extensions are language specific. AFAIK, all the languages supported by GCC are compiled to a Lisp-like intermediate code by the language specific frontend. The resulting code is then compiled by the compiler backend. Therefore, the C++ frontend will likely not be able to handle a C extension, and vice-versa.

I could be wrong of course: I don''t know GCC''s internals, so feel free to correct me.


Hope this helps.
Umm... I meant I thought gcc was the same thing as g++. Just another name for it. I guess I was wrong.
gcc used to stand for GNU C Compiler. Now, it stands for GNU Compiler Collection, and includes the C compiler (gcc), the C++ compiler (g++), the pascal compiler, as well as a couple others (I forget exactly which ones).
daerid@gmail.com
C, C++, Object C, Fortran, Java, and Ada are supported by gnu, and there are many other front-ends available.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
gcc will call the correct back end for the job. You need C++? It''ll send your code to g++. You need Fortran? g77 handles it. Etc.

As noted, the best solution may be to use another language. OCaml might be a good place to start (good reputation for speed, supports procedural, OO, and functional paradigms (with a focus on functional))

This topic is closed to new replies.

Advertisement