www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Boost.ScopeExit based on D's scope(exit)

reply Leandro Lucarella <llucax gmail.com> writes:
Boost 1.38.0 includes a new library ScopeExit:
http://www.boost.org/users/news/version_1_38_0

This library is based on D's scope(exit) according to the documentation,
see at the end of the link:
http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
¿Pero cómo? ¿Todavía votan?
	-- Sidharta Kiwi
Mar 02 2009
next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Mar 2, 2009 at 1:24 PM, Leandro Lucarella <llucax gmail.com> wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0

 This library is based on D's scope(exit) according to the documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html
Lol, it's fun to see how horrible C++ is every once in a while.
Mar 02 2009
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0
 
 This library is based on D's scope(exit) according to the documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html
 
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do... Andrei
Mar 02 2009
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
news:goh9ao$96r$1 digitalmars.com...
 I invented the gorram scope(exit) statement
I see what you did there. Another browncoat! Shiny :)
Mar 02 2009
prev sibling next sibling parent reply Leandro Lucarella <llucax gmail.com> writes:
Andrei Alexandrescu, el  2 de marzo a las 10:42 me escribiste:
 Leandro Lucarella wrote:
Boost 1.38.0 includes a new library ScopeExit:
http://www.boost.org/users/news/version_1_38_0
This library is based on D's scope(exit) according to the documentation,
see at the end of the link:
http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Is there any particular reason why you are so concerned about credits? I'm not saying they don't matter, but you seem to take it too hard. PS: My signature taglines are random, *really* =) -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- Ambition makes you look pretty ugly
Mar 02 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Leandro Lucarella wrote:
 Andrei Alexandrescu, el  2 de marzo a las 10:42 me escribiste:
 Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0
 This library is based on D's scope(exit) according to the documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Is there any particular reason why you are so concerned about credits? I'm not saying they don't matter, but you seem to take it too hard.
I'm, if anything, at the very low end of credit-beggars foodchain. You wouldn't believe if I told you about some (rather notorious within the community) people I know that ought to be a tad more modest :o). I just have a dim view of not giving credit. Proper credit is extremely easy to give, costs nothing, and is the right thing to do. The author of ScopeExit clearly knew everything of ScopeGuard since he linked to it, but did not quite acknowledge the relationship of his work to ScopeGuard, which should be done even assuming he developed ScopeExit entirely in isolation. That's just... you don't do that. Andrei
Mar 02 2009
next sibling parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Mar 2, 2009 at 2:23 PM, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:
 I'm, if anything, at the very low end of credit-beggars foodchain. You
 wouldn't believe if I told you about some (rather notorious within the
 community) people I know that ought to be a tad more modest :o). I just have
 a dim view of not giving credit. Proper credit is extremely easy to give,
 costs nothing, and is the right thing to do. The author of ScopeExit clearly
 knew everything of ScopeGuard since he linked to it, but did not quite
 acknowledge the relationship of his work to ScopeGuard, which should be done
 even assuming he developed ScopeExit entirely in isolation. That's just...
 you don't do that.
For what it's worth, the D docs page that he links to doesn't mention your name at all. I mean, I suppose Walter could give credit for each feature but that seems a bit out of place in a formal spec. Only in http://www.digitalmars.com/d/2.0/exception-safe.html are you actually mentioned, and even there it doesn't really credit you as the inventor of the idea, just that you argued for it.
Mar 02 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Jarrett Billingsley wrote:
 On Mon, Mar 2, 2009 at 2:23 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:
 I'm, if anything, at the very low end of credit-beggars foodchain. You
 wouldn't believe if I told you about some (rather notorious within the
 community) people I know that ought to be a tad more modest :o). I just have
 a dim view of not giving credit. Proper credit is extremely easy to give,
 costs nothing, and is the right thing to do. The author of ScopeExit clearly
 knew everything of ScopeGuard since he linked to it, but did not quite
 acknowledge the relationship of his work to ScopeGuard, which should be done
 even assuming he developed ScopeExit entirely in isolation. That's just...
 you don't do that.
For what it's worth, the D docs page that he links to doesn't mention your name at all. I mean, I suppose Walter could give credit for each feature but that seems a bit out of place in a formal spec. Only in http://www.digitalmars.com/d/2.0/exception-safe.html are you actually mentioned, and even there it doesn't really credit you as the inventor of the idea, just that you argued for it.
I know. What happens is that Walter introduced the construct in the language after he had internalized it so well, he might as well have thought of it himself. Then he changed the syntax, implemented it from scratch, so after all that work it's easy to think, heck, it's my work. What happens since Walter made a team with Bartosz and myself is that the exchange of ideas is so thick, sometimes it's funny how we all surprise one another candidly assuming paternity (and rightly) for a given concept. For example, for const/immutable my guess is that each of us feels entitled to think of it as his brainchild. (Sorry hasen.) Which is in fact the truth. Same about introducing default-isolation in D. Bartosz was extremely opposed to it in the beginning, I remember a huge debate about it at Kahili. A couple of months later, it was almost his idea :o). I'm no more lucid. Every once in a while I need to remind myself that local instantiation, a very cool feature unique to D, was Walter's idea that I merely stumbled upon. Neither of us initially knew how good it was... Andrei
Mar 02 2009
parent Christopher Wright <dhasenan gmail.com> writes:
Andrei Alexandrescu wrote:
 Same about introducing default-isolation in D. 
 Bartosz was extremely opposed to it in the beginning, I remember a huge 
 debate about it at Kahili. A couple of months later, it was almost his 
 idea :o). I'm no more lucid. Every once in a while I need to remind 
 myself that local instantiation, a very cool feature unique to D, was 
 Walter's idea that I merely stumbled upon. Neither of us initially knew 
 how good it was...
These last two receive far less attention than const. What is default isolation? What is local instantiation?
Mar 02 2009
prev sibling parent reply Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Leandro Lucarella wrote:
 Andrei Alexandrescu, el  2 de marzo a las 10:42 me escribiste:
 Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0
 This library is based on D's scope(exit) according to the 
 documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_ex
t/alternatives.html 
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Is there any particular reason why you are so concerned about credits? I'm not saying they don't matter, but you seem to take it too hard.
I'm, if anything, at the very low end of credit-beggars foodchain. You wouldn't believe if I told you about some (rather notorious within the community) people I know that ought to be a tad more modest :o). I just have a dim view of not giving credit. Proper credit is extremely easy to give, costs nothing, and is the right thing to do. The author of ScopeExit clearly knew everything of ScopeGuard since he linked to it, but did not quite acknowledge the relationship of his work to ScopeGuard, which should be done even assuming he developed ScopeExit entirely in isolation. That's just... you don't do that.
I'm at the low end too. For example, rdmd is based on my original idea. But by not begging around for acknowledgements, I bet nobody at all knows it anymore. Many years ago I sent a private mail to Walter with the idea, six months later I started advocating it vigorously on this NG, later I mailed a shell script to him that does what rdmd does now. The whole concept is mine, right down to shebangs in D source files and caching binaries. Heh, so incidentally, there might be some point in activating myself in that area. Also outside of the D community.... :-( The biggest lie I've ever heard is "the meek shall inherit the earth".
Mar 03 2009
next sibling parent reply BCS <ao pathlink.com> writes:
Reply to Georg,

 
 The biggest lie I've ever heard is "the meek shall inherit the earth".
 
That is a bit out of context... OTOH have you looked that the earth recently? Frankly I'd rather NOT inherit it thank you very much.
Mar 03 2009
parent "Nick Sabalausky" <a a.a> writes:
"BCS" <ao pathlink.com> wrote in message 
news:78ccfa2d3b5a88cb6a0c5cbbeee3 news.digitalmars.com...
 Reply to Georg,

 The biggest lie I've ever heard is "the meek shall inherit the earth".
That is a bit out of context... OTOH have you looked that the earth recently? Frankly I'd rather NOT inherit it thank you very much.
It'd be too hard to find room for it in my closet anyway.
Mar 03 2009
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 Andrei Alexandrescu wrote:
 Leandro Lucarella wrote:
 Andrei Alexandrescu, el  2 de marzo a las 10:42 me escribiste:
 Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0
 This library is based on D's scope(exit) according to the 
 documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_ex
t/alternatives.html 
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Is there any particular reason why you are so concerned about credits? I'm not saying they don't matter, but you seem to take it too hard.
I'm, if anything, at the very low end of credit-beggars foodchain. You wouldn't believe if I told you about some (rather notorious within the community) people I know that ought to be a tad more modest :o). I just have a dim view of not giving credit. Proper credit is extremely easy to give, costs nothing, and is the right thing to do. The author of ScopeExit clearly knew everything of ScopeGuard since he linked to it, but did not quite acknowledge the relationship of his work to ScopeGuard, which should be done even assuming he developed ScopeExit entirely in isolation. That's just... you don't do that.
I'm at the low end too. For example, rdmd is based on my original idea. But by not begging around for acknowledgements, I bet nobody at all knows it anymore. Many years ago I sent a private mail to Walter with the idea, six months later I started advocating it vigorously on this NG, later I mailed a shell script to him that does what rdmd does now. The whole concept is mine, right down to shebangs in D source files and caching binaries. Heh, so incidentally, there might be some point in activating myself in that area. Also outside of the D community.... :-( The biggest lie I've ever heard is "the meek shall inherit the earth".
I had no idea. Good you told me, I've put an ack in the source file. By the way, I added a couple more flags: Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]... Builds (with dependents) and runs a D program. Example: rdmd -release myprog --myprogparm 5 Any option to be passed to dmd must occur before the program name. In addition to dmd options, rdmd recognizes the following options: --build-only just build the executable, don't run it --chatty write dmd commands to stdout before executing them --compiler=comp use the specified compiler (e.g. gdmd) instead of dmd --dry-run do not compile, just show what commands would be run (implies --chatty) --force force a rebuild even if apparently not necessary --eval=code evaluate code a la perl -e --loop assume "foreach (line; stdin.byLine()) { ... }" for eval --help this message --man open web browser on manual page --shebang rdmd is in a shebang line (put as first argument) Of particular interest are --eval and --loop. Very helpful :o). Andrei
Mar 03 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Andrei Alexandrescu wrote:
 Leandro Lucarella wrote:
 Andrei Alexandrescu, el  2 de marzo a las 10:42 me escribiste:
 Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0
 This library is based on D's scope(exit) according to the 
 documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_ex
t/alternatives.html 
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Is there any particular reason why you are so concerned about credits? I'm not saying they don't matter, but you seem to take it too hard.
I'm, if anything, at the very low end of credit-beggars foodchain. You wouldn't believe if I told you about some (rather notorious within the community) people I know that ought to be a tad more modest :o). I just have a dim view of not giving credit. Proper credit is extremely easy to give, costs nothing, and is the right thing to do. The author of ScopeExit clearly knew everything of ScopeGuard since he linked to it, but did not quite acknowledge the relationship of his work to ScopeGuard, which should be done even assuming he developed ScopeExit entirely in isolation. That's just... you don't do that.
I'm at the low end too. For example, rdmd is based on my original idea. But by not begging around for acknowledgements, I bet nobody at all knows it anymore. Many years ago I sent a private mail to Walter with the idea, six months later I started advocating it vigorously on this NG, later I mailed a shell script to him that does what rdmd does now. The whole concept is mine, right down to shebangs in D source files and caching binaries. Heh, so incidentally, there might be some point in activating myself in that area. Also outside of the D community.... :-( The biggest lie I've ever heard is "the meek shall inherit the earth".
I had no idea. Good you told me, I've put an ack in the source file.
Thanks. I tried to locate the source in the dmd tree, but in vain. So probably it should appear when rdmd is run with no arguments for there to be any effect... :-)
 By the way, I added a couple more flags:
 
 Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]...
 Builds (with dependents) and runs a D program.
 Example: rdmd -release myprog --myprogparm 5
 
 Any option to be passed to dmd must occur before the program name. In 
 addition
 to dmd options, rdmd recognizes the following options:
   --build-only      just build the executable, don't run it
   --chatty          write dmd commands to stdout before executing them
   --compiler=comp   use the specified compiler (e.g. gdmd) instead of dmd
Heh, had to actually use this one when I checked rdmd before posting. Now i have dmd1 and dmd2 and obviously needed this.
   --dry-run         do not compile, just show what commands would be run
                       (implies --chatty)
   --force           force a rebuild even if apparently not necessary
   --eval=code       evaluate code a la perl -e
   --loop            assume "foreach (line; stdin.byLine()) { ... }" for 
 eval
   --help            this message
   --man             open web browser on manual page
   --shebang         rdmd is in a shebang line (put as first argument)
If foo.d is to be run like $ ./foo.d then rdmd has to be on the shebang line anyway. And if you run $ rdmd foo.d then you're already running rdmd. So, where do you use --shebang?
 Of particular interest are --eval and --loop. Very helpful :o).
Oh, these both are cool! PS: are you using zsh? The examples on http://www.digitalmars.com/d/2.0/rdmd.html have a percent prompt instead of the dollar prompt. Zsh seems to be fading out, the faq http://zsh.sourceforge.net/FAQ/zshfaq01.html is from 2005, and the last Fedora doesn't even have zsh as an option.
Mar 04 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 I had no idea. Good you told me, I've put an ack in the source file.
Thanks. I tried to locate the source in the dmd tree, but in vain. So probably it should appear when rdmd is run with no arguments for there to be any effect... :-)
It's on dsource under phobos/tools. On http://www.digitalmars.com/d/2.0/rdmd.html, there's a "download" link. (I have just checked it in.)
 By the way, I added a couple more flags:

 Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]...
 Builds (with dependents) and runs a D program.
 Example: rdmd -release myprog --myprogparm 5

 Any option to be passed to dmd must occur before the program name. In 
 addition
 to dmd options, rdmd recognizes the following options:
   --build-only      just build the executable, don't run it
   --chatty          write dmd commands to stdout before executing them
   --compiler=comp   use the specified compiler (e.g. gdmd) instead of dmd
Heh, had to actually use this one when I checked rdmd before posting. Now i have dmd1 and dmd2 and obviously needed this.
   --dry-run         do not compile, just show what commands would be run
                       (implies --chatty)
   --force           force a rebuild even if apparently not necessary
   --eval=code       evaluate code a la perl -e
   --loop            assume "foreach (line; stdin.byLine()) { ... }" 
 for eval
   --help            this message
   --man             open web browser on manual page
   --shebang         rdmd is in a shebang line (put as first argument)
If foo.d is to be run like $ ./foo.d then rdmd has to be on the shebang line anyway. And if you run $ rdmd foo.d then you're already running rdmd. So, where do you use --shebang?
Because of the primitive way the shell parses the shebang line. Consider: ... code ... All's dandy. Now say I want also -O: ... code ... No go. The shell passes "-unittest -O" as one argument to rdmd, which is not recognized as a flag. Always parsing the spaces away is not an option because there are filenames and string arguments with spaces. So I added --shebang to mean, parse the spaces in this argument: ... code ...
 Of particular interest are --eval and --loop. Very helpful :o).
Oh, these both are cool! PS: are you using zsh? The examples on http://www.digitalmars.com/d/2.0/rdmd.html have a percent prompt instead of the dollar prompt. Zsh seems to be fading out, the faq http://zsh.sourceforge.net/FAQ/zshfaq01.html is from 2005, and the last Fedora doesn't even have zsh as an option.
Yah. I didn't know it was going away. To me it seems pretty powerful, e.g. more so than bash. Bummer... Andrei
Mar 04 2009
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 I had no idea. Good you told me, I've put an ack in the source file.
Thanks. I tried to locate the source in the dmd tree, but in vain. So probably it should appear when rdmd is run with no arguments for there to be any effect... :-)
It's on dsource under phobos/tools. On http://www.digitalmars.com/d/2.0/rdmd.html, there's a "download" link. (I have just checked it in.)
For reference, the rdmd 1.2 code (included with GDC) is available at: http://dgcc.svn.sourceforge.net/viewvc/dgcc/trunk/d/rdmd.d?view=markup --anders
Mar 04 2009
prev sibling next sibling parent reply Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 I had no idea. Good you told me, I've put an ack in the source file.
Thanks. I tried to locate the source in the dmd tree, but in vain. So probably it should appear when rdmd is run with no arguments for there to be any effect... :-)
It's on dsource under phobos/tools. On http://www.digitalmars.com/d/2.0/rdmd.html, there's a "download" link. (I have just checked it in.)
Yes! Had to make the following changes to compile it (I'm on dmd2025): $ diff rdmd.d-orig rdmd.d 34c34 < immutable string importWorld = " ---
 immutable string importWorld = """
46c46 < std.zlib;"; ---
     std.zlib;""";
298,300c298,299 < File depsReader; < depsReader.popen(depsGetter); < scope(exit) collectException(depsReader.close); // we don't care for errors ---
     auto depsReader = popen(depsGetter);
     scope(exit) fclose(depsReader);  // we don't care for errors
 then you're already running rdmd. So, where do you use --shebang?
Because of the primitive way the shell parses the shebang line. Consider: ... code ... All's dandy. Now say I want also -O: ... code ... No go. The shell passes "-unittest -O" as one argument to rdmd, which is not recognized as a flag. Always parsing the spaces away is not an option because there are filenames and string arguments with spaces. So I added --shebang to mean, parse the spaces in this argument: ... code ...
Yes, I've many times wondered about that. Somehow, with linux, (and previously with unices) most of the time when something lookes stupid, turns out there is a profound reason for it.
 Of particular interest are --eval and --loop. Very helpful :o).
Oh, these both are cool! PS: are you using zsh? The examples on http://www.digitalmars.com/d/2.0/rdmd.html have a percent prompt instead of the dollar prompt. Zsh seems to be fading out, the faq http://zsh.sourceforge.net/FAQ/zshfaq01.html is from 2005, and the last Fedora doesn't even have zsh as an option.
Yah. I didn't know it was going away. To me it seems pretty powerful, e.g. more so than bash. Bummer...
Yeah, I used csh back when the only other option was sh. Had to switch later, too. And now a major gripe: I have just spent *half a day* trying to figure out what's wrong when I try to use shebang with rdmd. I was basically using hello.d with a shebang. And with rdmd I got this peculiar error message: .d'nnot read file ' /usr/local/digitalmars/dmd1040/linux/bin/rdmd: Couldn't compile or execute ./numma.d. Just now I figured it out: numma.d was a copy of hello.d, which of course has Windows line endings. Aaaaaaaaaaaaaaaarrrrghhhhhh!
Mar 04 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Georg Wrede wrote:
 And now a major gripe: I have just spent *half a day* trying to figure 
 out what's wrong when I try to use shebang with rdmd. I was basically 
 using hello.d with a shebang. And with rdmd I got this peculiar error 
 message:
 
 .d'nnot read file '
 /usr/local/digitalmars/dmd1040/linux/bin/rdmd: Couldn't compile or 
 execute ./numma.d.
 
 Just now I figured it out: numma.d was a copy of hello.d, which of 
 course has Windows line endings. Aaaaaaaaaaaaaaaarrrrghhhhhh!
Is that a bug in rdmd or elsewhere? We should as far as possible work seamlessly with different line endings.
Mar 04 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Walter Bright wrote:
 Georg Wrede wrote:
 And now a major gripe: I have just spent *half a day* trying to figure 
 out what's wrong when I try to use shebang with rdmd. I was basically 
 using hello.d with a shebang. And with rdmd I got this peculiar error 
 message:

 .d'nnot read file '
 /usr/local/digitalmars/dmd1040/linux/bin/rdmd: Couldn't compile or 
 execute ./numma.d.

 Just now I figured it out: numma.d was a copy of hello.d, which of 
 course has Windows line endings. Aaaaaaaaaaaaaaaarrrrghhhhhh!
Is that a bug in rdmd or elsewhere? We should as far as possible work seamlessly with different line endings.
No, it's bash having a problem. And I wouldn't make a bug report, it's too much to ask that all of linux is made msdos-file proof. :-) The shebang stuff stumbles on a ^M at the end. I tested it without rdmd and got the same problem.
Mar 04 2009
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Georg Wrede wrote:
 No, it's bash having a problem.
 
 And I wouldn't make a bug report, it's too much to ask that all of linux 
 is made msdos-file proof. :-)
Linux has actually gotten a lot better. As late as 2000, even gnu make couldn't read makefiles with CR's in them.
 The shebang stuff stumbles on a ^M at the end. I tested it without rdmd 
 and got the same problem.
At least it lets us off the hook!
Mar 04 2009
parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Wed, Mar 4, 2009 at 6:11 PM, Walter Bright
<newshound1 digitalmars.com> wrote:
 Linux has actually gotten a lot better. As late as 2000, even gnu make
 couldn't read makefiles with CR's in them.
OT - it's weird to think that that was almost a decade ago. Ten years! 2000 used to sound so futuristic, and now it sounds quaint :P
Mar 04 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Jarrett Billingsley wrote:
 On Wed, Mar 4, 2009 at 6:11 PM, Walter Bright
 <newshound1 digitalmars.com> wrote:
 Linux has actually gotten a lot better. As late as 2000, even gnu make
 couldn't read makefiles with CR's in them.
OT - it's weird to think that that was almost a decade ago. Ten years! 2000 used to sound so futuristic, and now it sounds quaint :P
Yep. Horrible. 2037 is approaching with giant leaps. That's the year I expect to die of old age, at 80. Better grab my Vodka right now!
Mar 04 2009
prev sibling parent Daniel Keep <daniel.keep.lists gmail.com> writes:
Georg Wrede wrote:
 Walter Bright wrote:
 Georg Wrede wrote:
 And now a major gripe: I have just spent *half a day* trying to
 figure out what's wrong when I try to use shebang with rdmd. I was
 basically using hello.d with a shebang. And with rdmd I got this
 peculiar error message:

 .d'nnot read file '
 /usr/local/digitalmars/dmd1040/linux/bin/rdmd: Couldn't compile or
 execute ./numma.d.

 Just now I figured it out: numma.d was a copy of hello.d, which of
 course has Windows line endings. Aaaaaaaaaaaaaaaarrrrghhhhhh!
Is that a bug in rdmd or elsewhere? We should as far as possible work seamlessly with different line endings.
No, it's bash having a problem. And I wouldn't make a bug report, it's too much to ask that all of linux is made msdos-file proof. :-) The shebang stuff stumbles on a ^M at the end. I tested it without rdmd and got the same problem.
Ray, when Cygwin asks if you want to use MSDOS newlines, you say YES! Of course, then it chokes on anything extracted from a tarball... -- Daniel
Mar 04 2009
prev sibling parent reply Georg Wrede <georg.wrede iki.fi> writes:
A suggestion: make the --eval temporary source file nicer looking:

46c46,47
<     std.zlib;";
---
     std.zlib;
 """;
121,122c122,123 < return .eval(importWorld ~ "void main(string[] args) { " < ~ "foreach (line; stdin.byLine()) { " ~ eval ~ "; } }"); ---
         return .eval(importWorld ~ "void main(string[] args)\n{\n"
             ~ "foreach (line; stdin.byLine()) { " ~ eval ~ ";\n}\n");
126,127c127,128 < return .eval(importWorld ~ "void main(string[] args) { " < ~ eval ~ "; }"); ---
         return .eval(importWorld ~ "void main(string[] args)\n{\n"
                 ~ eval ~ ";\n}\n");
This helps debugging by putting the "user code" properly on its own lines.
Mar 04 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Should I be able to

$ rdmd --eval='printf("Yay, rdmd!")'
Mar 04 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 Should I be able to
 
 $ rdmd --eval='printf("Yay, rdmd!")'
 
Yah. For my money, I can't fathom working in D without rdmd. Now with --eval and passable regexes it's even better because I can easily do tasks (from shell files) that would take longer in Perl. Since the current source uses the not-yet-released phobos, I wanted to attach a binary so you can try it, but it's too big for the news server. Andrei
Mar 04 2009
next sibling parent reply Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Should I be able to
 
 $ rdmd --eval='printf("Yay, rdmd!")'
 
Yah. For my money, I can't fathom working in D without rdmd.
You can't imagine the initial resistance... :-)
 Now with --eval and passable regexes it's even better because I can
 easily do tasks (from shell files) that would take longer in Perl.
That, and one could concentrate on one language. And Pride!! "We do it with D!"
 Since the current source uses the not-yet-released phobos, I wanted
 to attach a binary so you can try it, but it's too big for the news
 server.
Yup, I've been fighting and tweaking and compiling... And the thought crossed my mind, too.
Mar 04 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Should I be able to

 $ rdmd --eval='printf("Yay, rdmd!")'
Yah. For my money, I can't fathom working in D without rdmd.
You can't imagine the initial resistance... :-)
 Now with --eval and passable regexes it's even better because I can
 easily do tasks (from shell files) that would take longer in Perl.
That, and one could concentrate on one language. And Pride!! "We do it with D!"
 Since the current source uses the not-yet-released phobos, I wanted
 to attach a binary so you can try it, but it's too big for the news
 server.
Yup, I've been fighting and tweaking and compiling... And the thought crossed my mind, too.
FYI, I just implemented caching of the executables generated by --eval. They'll be kept around for 24 hours. It's pretty neat. On my laptop, the first --eval='printf("Yay, rdmd!\n")' takes 0.34 seconds to compile and run. Subsequent calls are under 0.1 (practically instant). Andrei
Mar 04 2009
parent reply Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Should I be able to

 $ rdmd --eval='printf("Yay, rdmd!")'
Yah. For my money, I can't fathom working in D without rdmd.
You can't imagine the initial resistance... :-)
 Now with --eval and passable regexes it's even better because I can
 easily do tasks (from shell files) that would take longer in Perl.
That, and one could concentrate on one language. And Pride!! "We do it with D!"
 Since the current source uses the not-yet-released phobos, I wanted
 to attach a binary so you can try it, but it's too big for the news
 server.
Yup, I've been fighting and tweaking and compiling... And the thought crossed my mind, too.
FYI, I just implemented caching of the executables generated by --eval. They'll be kept around for 24 hours. It's pretty neat. On my laptop, the first --eval='printf("Yay, rdmd!\n")' takes 0.34 seconds to compile and run. Subsequent calls are under 0.1 (practically instant).
Just downloaded D 2.026 and tried rdmd. No eval????? $ rdmd --help Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]... Builds (with dependents) and runs a D program. Example: rdmd -release myprog --myprogparm 5 Any option to be passed to dmd must occur before the program name. In addition to dmd options, rdmd recognizes the following options: --build-only just build the executable, don't run it --chatty write dmd commands to stdout before executing them --compiler=comp use the specified compiler (e.g. gdmd) instead of dmd --dry-run do not compile, just show what commands would be run (implies --chatty) --force force a rebuild even if apparently not necessary --help this message --man open web browser on manual page I'd *really* appreciate a --version switch. (Probably, instead of fancy version numbers, either the repo version, and/or just plain compilation date would be nice.) Currently, since the binary is packed, there is no way to even peek at the strings in hopes of getting a clue.... It also seems to accept just any switch: $ rdmd --bullcrap="bull crap" Error: crap.d: No such file or directory And from my bash dmd-wrapper log: compiling /usr/local/digitalmars/dmd2026/linux/bin/dmd --bullcrap=bull -v -o- crap.d -------- I hope it's not just me...
Mar 05 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Georg Wrede wrote:
 Just downloaded D 2.026 and tried rdmd. No eval?????
Sorry, inclusion of the new rdmd has not been done due to rdmd's dependency of the new phobos.
 I'd *really* appreciate a --version switch. (Probably, instead of fancy 
 version numbers, either the repo version, and/or just plain compilation 
 date would be nice.) Currently, since the binary is packed, there is no 
 way to even peek at the strings in hopes of getting a clue....
What would it do?
 It also seems to accept just any switch:
 
 $ rdmd --bullcrap="bull crap"
 Error: crap.d: No such file or directory
 
 And from my bash dmd-wrapper log:
 
 compiling /usr/local/digitalmars/dmd2026/linux/bin/dmd --bullcrap=bull 
 -v -o- crap.d
Yah, rdmd passed the buck to dmd. Previously rdmd also had a bug related to whitespace in options, which in turn was a quick fix to the gorram shebang issue, which I now fixed the proper way by adding --shebang. Anyhoo, with what I have now the erroneous flag is properly reported. Per popular demand (from one person that is :o)), I made the Linux rdmd binary available for download from http://ssli.ee.washington.edu/~aalexand/d/rdmd. Andrei
Mar 05 2009
parent Georg Wrede <georg.wrede iki.fi> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Just downloaded D 2.026 and tried rdmd. No eval?????
Sorry, inclusion of the new rdmd has not been done due to rdmd's dependency of the new phobos.
 I'd *really* appreciate a --version switch. (Probably, instead of 
 fancy version numbers, either the repo version, and/or just plain 
 compilation date would be nice.) Currently, since the binary is 
 packed, there is no way to even peek at the strings in hopes of 
 getting a clue....
What would it do?
Say I have a few DMD versions, and an rdmd with each. Then I download one from the net, and additionally I'm compiling two more. It actually happens intermittently that I end up running not the one I expect. When all works ok, who needs to know anything. But when things don't and you're full of WTF bewilderment, then it saves time to have access to things like version. Or suppose people start sending you bug reports. (Not impossible if rdmd gets popular.) Some admin may have moved rdmd to /usr/local/bin, somebody else got a newer version from the net... Any time I've called a hotline, the first thing they ask is what version.
 It also seems to accept just any switch:
With --version I wouldn't even have spent time writing this, I would just have understood that I got the ancient version.
 $ rdmd --bullcrap="bull crap"
 Error: crap.d: No such file or directory

 And from my bash dmd-wrapper log:

 compiling /usr/local/digitalmars/dmd2026/linux/bin/dmd --bullcrap=bull 
 -v -o- crap.d
Yah, rdmd passed the buck to dmd. Previously rdmd also had a bug related to whitespace in options, which in turn was a quick fix to the gorram shebang issue, which I now fixed the proper way by adding --shebang. Anyhoo, with what I have now the erroneous flag is properly reported. Per popular demand (from one person that is :o)), I made the Linux rdmd binary available for download from http://ssli.ee.washington.edu/~aalexand/d/rdmd.
Got it. Thanks. $ rdmd --eval="printf()" /tmp/.rdmd/eval.6B6D8AE14A1B676C8EC2203340D3209A.d(10): module range cannot read file 'std/range.d' What this means in practice is, rdmd should be "harmonised" with the DMD release it comes with. I wonder if Walter has a makefile that generates a new DMD download? If so, then of course it could build rdmd with the appropriate imports.
Mar 05 2009
prev sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Should I be able to

 $ rdmd --eval='printf("Yay, rdmd!")'
Yah. For my money, I can't fathom working in D without rdmd. Now with --eval and passable regexes it's even better because I can easily do tasks (from shell files) that would take longer in Perl. Since the current source uses the not-yet-released phobos, I wanted to attach a binary so you can try it, but it's too big for the news server. Andrei
It would be nice to have a config file that lets me specify the default imports and compiler (though this would make it slower). I can send you a patch for this, but I can't seem to build rdmd without modifications; it requires a struct File that has a method popen(string). I can change File to FILE* and make a few minor changes to get it to compile, which is what I did. Anyway, my modifications look for a config file: in /etc/ in /usr/local/etc in the exe directory Currently it just looks for default imports and the compiler name. Other things to add are compiler flags, and maybe dsss support. The solution for getting the exe directory isn't included in phobos, as far as I could tell. Perhaps you'd like to change that.
Mar 05 2009
next sibling parent Christopher Wright <dhasenan gmail.com> writes:
Christopher Wright wrote:
 Andrei Alexandrescu wrote:
 Georg Wrede wrote:
 Should I be able to

 $ rdmd --eval='printf("Yay, rdmd!")'
Yah. For my money, I can't fathom working in D without rdmd. Now with --eval and passable regexes it's even better because I can easily do tasks (from shell files) that would take longer in Perl. Since the current source uses the not-yet-released phobos, I wanted to attach a binary so you can try it, but it's too big for the news server. Andrei
It would be nice to have a config file that lets me specify the default imports and compiler (though this would make it slower). I can send you a patch for this, but I can't seem to build rdmd without modifications; it requires a struct File that has a method popen(string). I can change File to FILE* and make a few minor changes to get it to compile, which is what I did. Anyway, my modifications look for a config file: in /etc/ in /usr/local/etc in the exe directory Currently it just looks for default imports and the compiler name. Other things to add are compiler flags, and maybe dsss support. The solution for getting the exe directory isn't included in phobos, as far as I could tell. Perhaps you'd like to change that.
This isn't quite ready yet, please ignore. Also, getopt is killing --eval.
Mar 06 2009
prev sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Okay, here's an improved version of rdmd with config files.

Added features:
- Config file
   - Specify a compiler
   - Specify default imports for --eval
   - Specify build flags
- Option to show source with --eval
- Changed the definition of "main" with --eval to use 'in char[][]' 
rather than 'string[]' (the args probably don't matter much anyway)
- Executables are stored in the temp directory, not the current 
directory. This way, they can be reused even if you change directories; 
and they don't clutter up your working directory.

Attached is a sample rdmd.conf as well as the modified source (based on 
r958 from the phobos repository).
Mar 07 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Christopher Wright wrote:
 Okay, here's an improved version of rdmd with config files.
Thanks, that's interesting.
 Added features:
 - Config file
   - Specify a compiler
   - Specify default imports for --eval
   - Specify build flags
I'm sorry, I think a config file is overkill. Perl has many more options and does fine without any configuration besides the envvar PERL5LIB. But indeed there must be a possibility to veer away from the hardcoded imports.
 - Option to show source with --eval
Sounds good.
 - Changed the definition of "main" with --eval to use 'in char[][]' 
 rather than 'string[]' (the args probably don't matter much anyway)
in char[][] is the worst of the pack because it's the supertype of both immutable and mutable. You're better off with either string[] or char[][].
 - Executables are stored in the temp directory, not the current 
 directory. This way, they can be reused even if you change directories; 
 and they don't clutter up your working directory.
That's a good idea.
 Attached is a sample rdmd.conf as well as the modified source (based on 
 r958 from the phobos repository).
Thanks. Let's hold off on that for a bit until we all have the same phobos. Andrei
Mar 07 2009
parent reply Christopher Wright <dhasenan gmail.com> writes:
Andrei Alexandrescu wrote:
 Christopher Wright wrote:
 Okay, here's an improved version of rdmd with config files.
Thanks, that's interesting.
 Added features:
 - Config file
   - Specify a compiler
   - Specify default imports for --eval
   - Specify build flags
I'm sorry, I think a config file is overkill. Perl has many more options and does fine without any configuration besides the envvar PERL5LIB. But indeed there must be a possibility to veer away from the hardcoded imports.
It depends on whether --eval is going to be used to any reasonable degree. I don't think it is, so config files are overkill.
 - Option to show source with --eval
Sounds good.
 - Changed the definition of "main" with --eval to use 'in char[][]' 
 rather than 'string[]' (the args probably don't matter much anyway)
in char[][] is the worst of the pack because it's the supertype of both immutable and mutable. You're better off with either string[] or char[][].
But tango doesn't deal with string. You could add at the top: static if (!is (string)) alias char[] string;
 - Executables are stored in the temp directory, not the current 
 directory. This way, they can be reused even if you change 
 directories; and they don't clutter up your working directory.
That's a good idea.
When I saw that rdmd put the executable with an insanely long name in my working copy, I was quite annoyed.
 Attached is a sample rdmd.conf as well as the modified source (based 
 on r958 from the phobos repository).
Thanks. Let's hold off on that for a bit until we all have the same phobos.
The only difference due to different phoboses is using FILE* rather than struct File.
Mar 07 2009
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Christopher Wright wrote:
 Andrei Alexandrescu wrote:
 Christopher Wright wrote:
 Okay, here's an improved version of rdmd with config files.
Thanks, that's interesting.
 Added features:
 - Config file
   - Specify a compiler
   - Specify default imports for --eval
   - Specify build flags
I'm sorry, I think a config file is overkill. Perl has many more options and does fine without any configuration besides the envvar PERL5LIB. But indeed there must be a possibility to veer away from the hardcoded imports.
It depends on whether --eval is going to be used to any reasonable degree. I don't think it is, so config files are overkill.
 - Option to show source with --eval
Sounds good.
 - Changed the definition of "main" with --eval to use 'in char[][]' 
 rather than 'string[]' (the args probably don't matter much anyway)
in char[][] is the worst of the pack because it's the supertype of both immutable and mutable. You're better off with either string[] or char[][].
But tango doesn't deal with string. You could add at the top: static if (!is (string)) alias char[] string;
 - Executables are stored in the temp directory, not the current 
 directory. This way, they can be reused even if you change 
 directories; and they don't clutter up your working directory.
That's a good idea.
When I saw that rdmd put the executable with an insanely long name in my working copy, I was quite annoyed.
 Attached is a sample rdmd.conf as well as the modified source (based 
 on r958 from the phobos repository).
Thanks. Let's hold off on that for a bit until we all have the same phobos.
The only difference due to different phoboses is using FILE* rather than struct File.
Thanks, Christopher. Just letting you (all) know, I just added support for multiple --eval occurences; stored the exe always in the temporary directory; and change the signature of main to take char[][]. Andrei
Mar 08 2009
prev sibling parent reply Georg Wrede <georg.wrede iki.fi> writes:
Christopher Wright wrote:
 Okay, here's an improved version of rdmd with config files.
 
 Added features:
 - Config file
   - Specify a compiler
   - Specify default imports for --eval
   - Specify build flags
 - Option to show source with --eval
 - Changed the definition of "main" with --eval to use 'in char[][]' 
 rather than 'string[]' (the args probably don't matter much anyway)
 - Executables are stored in the temp directory, not the current 
 directory. This way, they can be reused even if you change directories; 
 and they don't clutter up your working directory.
 
 Attached is a sample rdmd.conf as well as the modified source (based on 
 r958 from the phobos repository).
Heh, the last line above is just another reason to include version information in rdmd! If one is lazy, then a /very/ practical way is simply to have string sourceFileVersion = "20090307 190230"; where the format is "yyyyMMdd hhmmss". A Cool guy would make his editor look for this string in any .d file in the pre-save hook, and update it. Entirely adequate, and a zero-effort amortized time complexity. :-) Something like the below code (from Christopher's attachment) would make it possible to know unambiguously and reliably what the executing program is. If there already isn't, there *absolutely should* exist a nice Phobos function to do just this!!!!! In D1 too.
 version (Posix)
 {
 	// Conforming to 4.4BSD -- this should be widely available
 	extern(C) size_t readlink(const char* path, char* buf, size_t buflength);
 	string exePath()
 	{
 		char[1024] exe;
 		// linux, darwin, solaris support /proc/self/exe
 		// freebsd is a laggard
 		auto size = readlink("/proc/self/exe".ptr, &exe[0], exe.length);
 		if (size >= 0)
 		{
 			return assumeUnique(exe[0..size]);
 		}
 		return null;
 	}
 }
 version (Windows)
 {
 	// Conforming to 4.4BSD -- this should be widely available
 	extern(C) DWORD GetModuleFileName(void* ptr, char* buf, DWORD size);
 	string exePath()
 	{
 		DWORD length;
 		char[1024] buf;
 		auto length = GetModuleFileName(null, buf.ptr, buf.length);
 		if (length)
 			return assumeUnique(buf[0..length]);
 		return null;
 	}
 }
 
Mar 07 2009
parent Christopher Wright <dhasenan gmail.com> writes:
Georg Wrede wrote:
 Christopher Wright wrote:
     extern(C) DWORD GetModuleFileName(void* ptr, char* buf, DWORD size);
Oops, GetModuleFileName doesn't conform to 4.4BSD. But yes, it should exist in Phobos. I looked for it in std.env and std.path and so forth, but to no avail.
Mar 07 2009
prev sibling parent "Lionello Lunesu" <lionello lunesu.remove.com> writes:
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
news:goh9ao$96r$1 digitalmars.com...
 Leandro Lucarella wrote:
 Boost 1.38.0 includes a new library ScopeExit:
 http://www.boost.org/users/news/version_1_38_0

 This library is based on D's scope(exit) according to the documentation,
 see at the end of the link:
 http://www.boost.org/doc/libs/1_38_0/libs/scope_exit/doc/html/scope_exit/alternatives.html
Cool. I confess I'm mildly miffed. In the "Acknowledge" section (sic) yours truly is being acknowledged "for pointing me to scope(exit) construct of the D programming language." In the Alternatives section there's an unatrributed link to the ScopeGuard article. My understanding of ScopeExit looks much more inspired and derivative from ScopeGuard than a distinct artifact, something that goes entirely unacknowledged. For some reason ScopeGuard and scope(exit) consistently escapes proper acknowledgments. Petru Marginean and I introduced the concept in C++ and argued for its usefulness. I invented the gorram scope(exit) statement for D, and Walter almost forgot to acknowledge me. And now this. What are you going to do...
Hey, at least you got explicitely quoted in the page's header: "...one of the most highly regarded and expertly designed C++ library projects in the world." - Herb Sutter and Andrei Alexandrescu, C++ Coding Standards L. PS: my god, I remember why I hate c++ and boost.. I've been clean (of C++) for 1 year now, and it feels great.
Mar 02 2009