ext/preprocessor/seq/foreach.bi

This file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.

Summary
ext/preprocessor/seq/foreach.biThis file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides
Macros
fbextPP_SeqForEachexpands to repeated expansions of the user-defined macro m_, passing them each element of the sequence seq_, in order, along with user data data_.
FBEXT_PP_SEQ_FOREACHis deprecated, use fbextPP_SeqForEach instead.

License

Copyright © 2007-2011, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides

Distributed under the Boost Software License, Version 1.0.  See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

Macros

fbextPP_SeqForEach

# define fbextPP_SeqForEach(
   m_,
   data_,
   seq_
) fbextPP_Repeat(fbextPP_SeqSize(seq_), fbextPP_SeqForEach_M, (m_, data_, seq_))

expands to repeated expansions of the user-defined macro m_, passing them each element of the sequence seq_, in order, along with user data data_.

m_ must have the form `foo(data_, elem_)`, where `data_` is the user-defined data_, and `elem_` is one of the elements in seq_.

For example, if data_ is `x` and seq_ is `(a)(b)(c)(d)`, then this macro expands to `m_(x, a) m_(x, b) m_(x, c) m_(x, d)`.

FBEXT_PP_SEQ_FOREACH

# define FBEXT_PP_SEQ_FOREACH(m_,
data_,
seq_) fbextPP_SeqForEach(m_, data_, seq_)

is deprecated, use fbextPP_SeqForEach instead.

# define fbextPP_SeqForEach(
   m_,
   data_,
   seq_
) fbextPP_Repeat(fbextPP_SeqSize(seq_), fbextPP_SeqForEach_M, (m_, data_, seq_))
expands to repeated expansions of the user-defined macro m_, passing them each element of the sequence seq_, in order, along with user data data_.
# define FBEXT_PP_SEQ_FOREACH(m_,
data_,
seq_) fbextPP_SeqForEach(m_, data_, seq_)
is deprecated, use fbextPP_SeqForEach instead.