guile-user
[Top][All Lists]
Advanced

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

Re: C++ STL


From: Maurício
Subject: Re: C++ STL
Date: Mon, 24 Jun 2002 17:50:01 -0300

    Yes, I think you are right. However, I think there are some ideas that
could be interesting to use. For instance, it would be nice if we could do
things like this:

(for_each_c++ (i (iota 1 10)) (line (file_lines "file_name.txt)) (in
stdinput)
    (some_function i line in))

meaning that some_function would be executed with i going from 1 to 9, line
would be consecutive lines from a file and in would be lines got from user
input (and the "loop" would finish when i or line became #f). In this
example, for_each_c++ itself could be a generator that would return the
consecutive values of some_function, and so it could be used inside another
for_each_c++ (or other iterator-aware algorithm).


    Maurício


"Eric E Moore" <address@hidden> wrote in message
news:address@hidden

>Not the whole STL, but good chunks of it.  For example we already have
a generic singly linked list type, with sort (sort), merge (merge),
copy (list-copy), transform (map) etc.  operations defined on it.
Similarly we have some functions for operating on tree structures
(built as lists of lists).  We have a (non-resizing) vector type,
which is less supported than the others, but at least can be sorted,
and supports a transform operation (of sorts).

>The way that variable access works in scheme means that iterators and
much of the rest of the STL aren't especially needed.

>It might be worth generalizing some of the functions, but most
schemers tend to use the list-based ones most of the time, which are
quite good.








reply via email to

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