Newbie Jamfile author question

(Thank you to Rene and David.) Rene, Are you referring to the parsing phase? Such behavior would not seem so harmful there (to me anyway). But if I add some actions, they get done twice, which does seem very harmful. I mean, it's like the updating phase gets done twice, not just the parsing. Here is another example Jamfile: ------------------------ begin Jamfile-------------------------- rule MyRule { Echo $(1) ; MyAction $(1) ; Depends all : $(1) ; } actions MyAction { touch $(1) ; echo $(1) andAgain ; } MyRule HelloAgain ; ------------------------ end Jamfile-------------------------- Here is the output: ------------------------ begin output-------------------------- c:/deleteme=> bjam HelloAgain HelloAgain ...found 9 targets... ...updating 1 target... MyAction HelloAgain HelloAgain andAgain ; MyAction HelloAgain HelloAgain andAgain ; ...updated 1 target... ------------------------ end Jamfile-------------------------- If the (lowercase) echo in MyAction had been a compilation, then I would have compiled all my files twice. (In fact, that is just the situation that led me construct this simple example.) Does bjam's behavior still seem OK to you? (I realize that bjam is used all the time by a zillion people--there must be somethng I'm doing wrong, or something I'm just not understanding--I'm sorry to be taking everyone's time with this.) Thanks again, Mike D.
-----Original Message----- From: boost-users-request@lists.boost.org [mailto:boost-users-request@lists.boost.org] Sent: Wednesday, September 13, 2006 3:37 PM To: boost-users@lists.boost.org Subject: Boost-users Digest, Vol 1026, Issue 7
Send Boost-users mailing list submissions to boost-users@lists.boost.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.boost.org/mailman/listinfo.cgi/boost-users or, via email, send a message with subject or body 'help' to boost-users-request@lists.boost.org
You can reach the person managing the list at boost-users-owner@lists.boost.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Boost-users digest..."
Today's Topics:
1. Re: bind, and member function with a parameter (Arkadiy Vertleyb) 2. multi_index library, dynamic number of indices ( Ad?n Cosgaya ) 3. Re: Newbie Jamfile author question (David Klein) 4. Re: bind, and member function with a parameter (Alexander Shyrokov) 5. Re: Newbie Jamfile author question (Rene Rivera) 6. mingw, bjam and Boost.Python tutorial problem (Import Error) (Sune Mai) 7. Re: multi_index library, dynamic number of indices (JOAQUIN LOPEZ MU?Z) 8. Re: Library Interface Design (Jens Theisen)
------------------------------------------------------------ ----------
Message: 1 Date: Wed, 13 Sep 2006 15:55:46 -0400 From: "Arkadiy Vertleyb"
Subject: Re: [Boost-users] bind, and member function with a parameter To: boost-users@lists.boost.org Message-ID: "Peter Dimov"
wrote Just an idea -- is it possible to have one universal set of placeholders in boost? Bind, Lambda, MPL, and possibly other libraries could then use some sort of redirection to their specialized placeholders... Might help to avoid some confusion.
This isn't possible in general
Not sure I understand why...
AFAIU, placeholders are either types (MPL), in which case some sort of traits can be used to redirect from, say, boost::_1 to mpl::_1, or const objects (Bind, Lambda), in which case some extra indirection through overload could possibly do the trick something like:
template<class T> T redirect(const T&); template<int n> bind::arg<n> redirect(const boost::arg<n>&);
Regards, Arkadiy
------------------------------
Message: 2 Date: Wed, 13 Sep 2006 17:37:44 -0300 From: " Ad?n Cosgaya "
Subject: [Boost-users] multi_index library, dynamic number of indices To: boost-users@lists.boost.org Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, I am using multi_index to keep a set of d-dimensional points, where each point is a vector inside the multi_index container. e.g (3,5,8,9,5) is a 5-dimensional point (but this can vary and be 3-d, 7-d, etc..). I need to have the set sorted by each of the dimensions.
I can do it statically if I know in advance how many dimensions I have, but I don't know how to make dynamic to any number of dimensions.
I currently have:
template<int N> struct nth_coordinate { typedef int result_type;
int operator()(const vector<int>& x)const { return x[N]; } };
typedef multi_index_container< vector<int>, indexed_by< sequenced<>, ordered_non_unique
>, ordered_non_unique >, ordered_non_unique >, ordered_non_unique >, ordered_non_unique > multi_index_Points;
is it possible do it without explicitly saying how many indices do I need?
Also, I am trying to create a function which receives as a parameter the dimension I want to work with, but it seems that I need to explicitly say the number of the index in nth_index (it obviously needs a constant). For example:
int median (int d){ ... typedef multi_index_Points::nth_index< d >::type multi_index_Points_it; ===> I would like to pass "d" as a parameter ... }
is there any workaround for this issues?
would you mind pointing me in the right direction with an example of how to do it with thelibrary?
thanks in advance...
Adan

Drumheller, Michael wrote:
(Thank you to Rene and David.) Rene, Are you referring to the parsing phase?
Yes.
Such behavior would not seem so harmful there (to me anyway). But if I add some actions, they get done twice, which does seem very harmful.
Yep :-)
I mean, it's like the updating phase gets done twice, not just the parsing.
It's because it will faithfully execute actions any number of times they are defined/parsed. Sorry about not mentioning this before, but I was kinda busy at the time to go looking for the relevant bit of code. You can check which phase it's parsing by checking the "gIN_LIB_INCLUDE" variable. It will be set during the declare (first) phase.
Does bjam's behavior still seem OK to you?
Well that a relative judgment. It not the incorrect behavior, even though it doesn't seem OK either. BBv2 doesn't have this behavior.
(I realize that bjam is used all the time by a zillion people
I wish ;-)
I'm sorry to be taking everyone's time with this.)
Speaking of that... Please don't reply to digests, and especially do not quote all the text in them http://boost.org/more/discussion_policy.htm#effective. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Rene Rivera
Sorry about not mentioning this before, but I was kinda busy at the time to go looking for the relevant bit of code. You can check which phase it's parsing by checking the "gIN_LIB_INCLUDE" variable. It will be set during the declare (first) phase.
I'll try v2.
Does bjam's behavior still seem OK to you?
Well that a relative judgment. It not the incorrect behavior, even though it doesn't seem OK either. BBv2 doesn't have this behavior.
I will try v2. Thank you. (Note: I realize I should probably direct future bjam-specific requests to the jamboost list, not this one. I'm just trying to close this thread gracefully.)
I'm sorry to be taking everyone's time with this.)
Speaking of that... Please don't reply to digests, and especially do not quote all the text in them http://boost.org/more/discussion_policy.htm#effective.
Quoting so much text was monumentally clumsy of me--I realized I had done it one nanosecond after I hit send, and my forehead is still bruised from slapping it so hard. I wholeheartedly apologize to everyone on the list. As for replying to digests, thank you for pointing out the gmane interface to me. I am replying via that now. Thanks again, Michael D.
participants (3)
-
Drumheller, Michael
-
Michael Drumheller
-
Rene Rivera