www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Diva (Dynamically Interconnected Variable Arguments) released!

reply David L. Davis <SpottedTiger yahoo.com> writes:
Diva was designed to simplify the handling of D's variadic function arguments,
and to find flexablity solutions for the following five requests found on the D
forum over the past few months:

1st: a simple way to pass through a list of arguments.
2nd: a way to add arguments to an existing list.
3rd: a way to re-order, insert, and remove arguments from the list.
4th: be able to access each argument individually through indexing.
5th: a way of passing the arglist of one variadic function directly to another.

By using Diva's ability to "get" and "set" data, values can be implicitly
convert stored values of non-exact datatypes whenever possible, allowing for a
polymorphic-like value passing to variables, otherwise it will return a default
value, avoiding any errors if all possible. And with Diva's methods like
"prepend, append, insert, splice, remove and copy()" D's variadic arguments
function parameter layout can be alter to suit the data requirements for a
function or the program. 

For more information about Diva v0.33 and to download the zipfile, just follow
the link below:
http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html

A special thanks to Walter, for his continuing hard work on the D aka Mars
compiler, and for making the fantastic possible!

Enjoy!!

David L.

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
-------------------------------------------------------------------

MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 06 2005
next sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
David L. Davis wrote:
 Diva was designed to simplify the handling of D's variadic function arguments,
 and to find flexablity solutions for the following five requests found on the D
 forum over the past few months:
 
 1st: a simple way to pass through a list of arguments.

 5th: a way of passing the arglist of one variadic function directly to another.

Is there a difference between these two requests? Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 07 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <dfmg70$30he$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
 Diva was designed to simplify the handling of D's variadic function arguments,
 and to find flexablity solutions for the following five requests found on the D
 forum over the past few months:
 
 1st: a simple way to pass through a list of arguments.

 5th: a way of passing the arglist of one variadic function directly to another.

Is there a difference between these two requests? Stewart.

Stewart, Since I didn't posts these requests, but copied them and used them as guideline, I'm not totally certain I've interpreted them exactly the same as the original poster would have. But the "1st" to me, means they wanted an easily hassle-free way to loop though the arguments...say for displaying or for printing. One way Diva can do this, is to extract with a get!(char[])(i) the arguments as a char[] parameter and then feed it to a writefln(). In fact the "1st" is more like the "4th" request, because both need to use an index in a get() method to extract the data. Where as, the "5th" is about pass the _arguments and _argptr data into other function, inwhich Diva can recieve these types of parameters as input (to change, remove from, add to), and Diva can also create these from nothing and pass them to other functions that accept the _arguments and _argptr parameters. Well I hope I've answered your question. I've created an example of how I think Diva solves all five of these requests on the "Diva Prjoect" web page, if you still want to check it out. Please, have a nice day! :) David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 07 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
David L. Davis wrote:
 In article <dfmg70$30he$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:


 1st: a simple way to pass through a list of arguments.

 5th: a way of passing the arglist of one variadic function directly to another.



 Since I didn't posts these requests, but copied them and used them as
guideline,
 I'm not totally certain I've interpreted them exactly the same as the original
 poster would have. But the "1st" to me, means they wanted an easily hassle-free
 way to loop though the arguments...say for displaying or for printing.

Oh, _that_ kind of pass. I guess "iterate" is a clearer word. I was interpreting the expression as "pass it through"....
 One way Diva can do this, is to extract with a get!(char[])(i) the arguments
as a char[]
 parameter and then feed it to a writefln(). In fact the "1st" is more like the
 "4th" request, because both need to use an index in a get() method to extract
 the data. Where as, the "5th" is about pass the _arguments and _argptr data
into
 other function, inwhich Diva can recieve these types of parameters as input (to
 change, remove from, add to), and Diva can also create these from nothing and
 pass them to other functions that accept the _arguments and _argptr parameters.

To me, the fifth point means being able to pass an argument list through to a function that is actually variadic rather than taking _arguments and _argptr. Maybe it can +be done with a bit of down and dirty work.... Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 07 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <dfmsf7$amf$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
 In article <dfmg70$30he$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:


 1st: a simple way to pass through a list of arguments.

 5th: a way of passing the arglist of one variadic function directly to another.



 Since I didn't posts these requests, but copied them and used them as
guideline,
 I'm not totally certain I've interpreted them exactly the same as the original
 poster would have. But the "1st" to me, means they wanted an easily hassle-free
 way to loop though the arguments...say for displaying or for printing.

Oh, _that_ kind of pass. I guess "iterate" is a clearer word. I was interpreting the expression as "pass it through"....
 One way Diva can do this, is to extract with a get!(char[])(i) the arguments
as a char[]
 parameter and then feed it to a writefln(). In fact the "1st" is more like the
 "4th" request, because both need to use an index in a get() method to extract
 the data. Where as, the "5th" is about pass the _arguments and _argptr data
into
 other function, inwhich Diva can recieve these types of parameters as input (to
 change, remove from, add to), and Diva can also create these from nothing and
 pass them to other functions that accept the _arguments and _argptr parameters.

To me, the fifth point means being able to pass an argument list through to a function that is actually variadic rather than taking _arguments and _argptr. Maybe it can +be done with a bit of down and dirty work.... Stewart.

Stewart, I agree that pushing though a (...) parameter function would be more ideal, but I've haven't cracked that shell just yet...and passing the _arguments and _argptr is the next best thing. Especially since you can do the following right now: # // Diva1.d # private import std.stdio; # private import std.boxer; # private import diva; # # // Burton Radons <burton-radons[at]smocky[dot]com> # // This entry allows -unittest for testing, # // and/or no need for the -release # switch # extern (C) void assert_3std5boxer() { } # # int main() # { # Diva oDiva = new Diva(0, # "char[]=\"%s\" uint=%d, long.max=%d, float=$%5.2f", # "Test"c, 123U, long.max, 234.45e+2f); # writefln("Using Diva and std.stdio.writefx()"); # std.stdio.writefx(stdout, oDiva.getArgType, oDiva.getArgValue, true); # writefln(); # // same as # writefln("Using only std.stdio.writefln(...)"); # std.stdio.writefln("char[]=\"%s\" uint=%d, long.max=%d, float=$%5.2f", # "Test"c, 123U, long.max, 234.45e+2f); # writefln(); # # // Removing the format string used in writefln() # oDiva.remove(0); # # writefln("Using Diva and std.boxer.boxArray()"); # Box[] boxxArr = boxArray(oDiva.getArgType, oDiva.getArgValue); # writefln # ("action: Display Box Array char[]=\"%s\", uint=%d, long=%d, float=%g", # unbox!(char[])(boxxArr[0]), # unbox!(uint) (boxxArr[1]), # unbox!(long) (boxxArr[2]), # unbox!(float) (boxxArr[3])); # writefln(); # // same as # writefln("Using only std.boxer.boxArray(...)"); # Box[] boxxArr2 = boxArray("Test"c, 123U, long.max, 234.45e+2f); # writefln # ("action: Display Box Array char[]=\"%s\", uint=%d, long=%d, float=%g", # unbox!(char[])(boxxArr2[0]), # unbox!(uint) (boxxArr2[1]), # unbox!(long) (boxxArr2[2]), # unbox!(float) (boxxArr2[3])); # writefln(); # return 0; # } Output: --------- C:\dmd>dmd diva1.d diva.d isnumeric.d C:\dmd\bin\..\..\dm\bin\link.exe diva1+diva+isnumeric,,,user32+kernel32/noi; C:\dmd>diva1 Using Diva and std.stdio.writefx() char[]="Test" uint=123, long.max=9223372036854775807, float=$23445.00 Using only std.stdio.writefln(...) char[]="Test" uint=123, long.max=9223372036854775807, float=$23445.00 Using Diva and std.boxer.boxArray() action: Display Box Array char[]="Test", uint=123, long=9223372036854775807, float=23445 Using only std.boxer.boxArray(...) action: Display Box Array char[]="Test", uint=123, long=9223372036854775807, float=23445 C:\dmd> ------------------ At the very least it is a good step forward IMHO, I hope you will agree. David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 07 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
David L. Davis wrote:
 In article <dfmsf7$amf$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:
 In article <dfmg70$30he$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:




 5th: a way of passing the arglist of one variadic function directly to another.





 To me, the fifth point means being able to pass an argument list through 
 to a function that is actually variadic rather than taking _arguments 
 and _argptr.  Maybe it can +be done with a bit of down and dirty work....

I agree that pushing though a (...) parameter function would be more ideal, but I've haven't cracked that shell just yet...and passing the _arguments and _argptr is the next best thing.

Only if you have a version of the function that accepts _arguments and _argptr. Otherwise, until you've got it sussed, your 5th point the way it's written is false advertising. It should be written instead "a way of passing the arglist of one variadic function directly to a function that takes _arguments and _argptr" or similar. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 13 2005
parent David L. Davis <SpottedTiger yahoo.com> writes:
In article <dg6avp$121u$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
 In article <dfmsf7$amf$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:
 In article <dfmg70$30he$1 digitaldaemon.com>, Stewart Gordon says...
 David L. Davis wrote:




 5th: a way of passing the arglist of one variadic function directly to another.





 To me, the fifth point means being able to pass an argument list through 
 to a function that is actually variadic rather than taking _arguments 
 and _argptr.  Maybe it can +be done with a bit of down and dirty work....

I agree that pushing though a (...) parameter function would be more ideal, but I've haven't cracked that shell just yet...and passing the _arguments and _argptr is the next best thing.

Only if you have a version of the function that accepts _arguments and _argptr. Otherwise, until you've got it sussed, your 5th point the way it's written is false advertising. It should be written instead "a way of passing the arglist of one variadic function directly to a function that takes _arguments and _argptr" or similar. Stewart.

Stewart, Don't sweat it man...I'll add something to the text, which will clarify this point a little better I have done. :) Also, as a funny side note, to answer any other questions that might pop-up: Disclaimer: "In the creation of Diva, no animals were harmed, no toxin waste spilled, and no damage was done to the ozone layer...in other words, "the universe as you know it hasn't been changed one single 'bit!'" <g> David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 14 2005
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
David L. Davis wrote:
<snip>
 http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html

I meant to tell you: there seems to be a bug in your HTML/CSS somewhere - the code on the page comes out white (and hence almost impossible to read) under Mozilla/SeaMonkey. You could start here: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 13 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <dg6bfv$12cq$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
<snip>
 http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html

I meant to tell you: there seems to be a bug in your HTML/CSS somewhere - the code on the page comes out white (and hence almost impossible to read) under Mozilla/SeaMonkey. You could start here: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ Stewart.

Thanks! It has been fixed. David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 14 2005
parent reply Derek Parnell <derek psych.ward> writes:
On Wed, 14 Sep 2005 10:58:34 +0000 (UTC), David L. Davis wrote:

 In article <dg6bfv$12cq$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
<snip>
 http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html

I meant to tell you: there seems to be a bug in your HTML/CSS somewhere - the code on the page comes out white (and hence almost impossible to read) under Mozilla/SeaMonkey. You could start here: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ Stewart.

Thanks! It has been fixed.

Still has lots of validation problems. ;-) -- Derek (skype: derek.j.parnell) Melbourne, Australia 15/09/2005 9:51:51 AM
Sep 14 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <o2ysjwn1l6dm.1dzab223s2w8h.dlg 40tude.net>, Derek Parnell says...
On Wed, 14 Sep 2005 10:58:34 +0000 (UTC), David L. Davis wrote:

 In article <dg6bfv$12cq$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
<snip>
 http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html

I meant to tell you: there seems to be a bug in your HTML/CSS somewhere - the code on the page comes out white (and hence almost impossible to read) under Mozilla/SeaMonkey. You could start here: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ Stewart.

Thanks! It has been fixed.

Still has lots of validation problems. ;-) -- Derek (skype: derek.j.parnell) Melbourne, Australia 15/09/2005 9:51:51 AM

True, but every now and again I do fixed a handful of W3C errors. Which may take some time to fix them all, since I currently have nearly 100 pages to maintain (and its still growing a page or two at a time), most of which are in the D programming section while the rest in my Art site. Just wish I could figure out how to move my sytlesheet out and have my webpages still work, but somehow my black background is always turning purple. Also, I do try my best to test every new page against both MS IE 6.x and the FoxFire v1.xx browsers, but I think I just plain missed doing that this time around with the Diva Project. I must have gotten a little burned out from spending too many midnights working on it, plus drawing the special artwork of Dyriia, and coming up with the kool name for the project, "Diva" (which in v0.1 it was called "ArgMesher" originally, but I thought that name was too long...plus it wasn't creative enough for my taste). David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 14 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
David L. Davis wrote:
 In article <o2ysjwn1l6dm.1dzab223s2w8h.dlg 40tude.net>, Derek Parnell says...
 On Wed, 14 Sep 2005 10:58:34 +0000 (UTC), David L. Davis wrote:

 In article <dg6bfv$12cq$1 digitaldaemon.com>, Stewart Gordon says...



 I meant to tell you: there seems to be a bug in your HTML/CSS somewhere 
 - the code on the page comes out white (and hence almost impossible to 
 read) under Mozilla/SeaMonkey.  You could start here:

 http://validator.w3.org/
 http://jigsaw.w3.org/css-validator/

 Stewart.



True, but every now and again I do fixed a handful of W3C errors.

What exactly did you mean by "it has been fixed"? Look: - there are still _lots_ of validation errors - there isn't even a DOCTYPE declaration - this is the first step, as you should know if you've ever tried validating - the aforementioned fault in the appearance is still there in all its glory Or have you simply forgotten to upload the "fixed" version? Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 15 2005
parent David L. Davis <SpottedTiger yahoo.com> writes:
In article <dgbi1g$pll$1 digitaldaemon.com>, Stewart Gordon says...
David L. Davis wrote:
 In article <o2ysjwn1l6dm.1dzab223s2w8h.dlg 40tude.net>, Derek Parnell says...
 On Wed, 14 Sep 2005 10:58:34 +0000 (UTC), David L. Davis wrote:

 In article <dg6bfv$12cq$1 digitaldaemon.com>, Stewart Gordon says...



 I meant to tell you: there seems to be a bug in your HTML/CSS somewhere 
 - the code on the page comes out white (and hence almost impossible to 
 read) under Mozilla/SeaMonkey.  You could start here:

 http://validator.w3.org/
 http://jigsaw.w3.org/css-validator/

 Stewart.



True, but every now and again I do fixed a handful of W3C errors.

What exactly did you mean by "it has been fixed"? Look: - there are still _lots_ of validation errors - there isn't even a DOCTYPE declaration - this is the first step, as you should know if you've ever tried validating - the aforementioned fault in the appearance is still there in all its glory Or have you simply forgotten to upload the "fixed" version? Stewart.

Stewart your timing couldn't be any better...<g> After I saw Derek Parnel post, I went in and edited the styleshheet more, then did some work in the main HTML. 1. - there are still _lots_ of validation errors Yes, there are still a number errors according to W3C's HTML checker, but I'm not going to have a heary-attack worrying about it at the moment...since both IE6 and FoxFire view things just fine. 2. - there isn't even a DOCTYPE declaration - this is the first step, as you should know if you've ever tried validating Yep, I commented it in when I was playing around fixing things and didn't uncomment back. (It's now uncommented, tho I'm still not up to the W3C standard for a HTML 4.0 Transitional document...anyway a person has to have goals to shoot for you know. <g>). 3. - the aforementioned fault in the appearance is still there in all its glory You're right yet again, I re-broke it / got caught not re-testing it against the FireFox browser, but the good news is, that it's now been re-fixed. David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Sep 15 2005