Jump to page: 1 2
Thread overview
Diva (Dynamically Interconnected Variable Arguments) released!
Sep 07, 2005
David L. Davis
Sep 07, 2005
Stewart Gordon
Sep 07, 2005
David L. Davis
Sep 07, 2005
Stewart Gordon
Sep 07, 2005
David L. Davis
Sep 13, 2005
Stewart Gordon
Sep 14, 2005
David L. Davis
Sep 13, 2005
Stewart Gordon
Sep 14, 2005
David L. Davis
Sep 14, 2005
Derek Parnell
Sep 15, 2005
David L. Davis
Sep 15, 2005
Stewart Gordon
Sep 15, 2005
David L. Davis
September 07, 2005
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
September 07, 2005
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.
<snip>
> 5th: a way of passing the arglist of one variadic function directly to another.
<snip>

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.
September 07, 2005
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.
><snip>
>> 5th: a way of passing the arglist of one variadic function directly to another.
><snip>
>
>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
September 07, 2005
David L. Davis wrote:
> In article <dfmg70$30he$1@digitaldaemon.com>, Stewart Gordon says...
>> David L. Davis wrote:
<snip>
>>> 1st: a simple way to pass through a list of arguments.
>> <snip>
>>> 5th: a way of passing the arglist of one variadic function directly to another.
>> <snip>
<snip>
> 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.
<snip>

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.
September 07, 2005
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:
><snip>
>>>> 1st: a simple way to pass through a list of arguments.
>>> <snip>
>>>> 5th: a way of passing the arglist of one variadic function directly to another.
>>> <snip>
><snip>
>> 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.
><snip>
>
>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
September 13, 2005
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:
<snip>
>>>>> 5th: a way of passing the arglist of one variadic function directly to another.
<snip>
>> 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. 
<snip>

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.
September 13, 2005
David L. Davis wrote:
<snip>
> http://spottedtiger.tripod.com/D_Language/D_Diva_Project_XP.html
<snip>

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.
September 14, 2005
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
><snip>
>
>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
September 14, 2005
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:
><snip>
>>>>>> 5th: a way of passing the arglist of one variadic function directly to another.
><snip>
>>> 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.
><snip>
>
>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
September 14, 2005
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
>><snip>
>>
>>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
« First   ‹ Prev
1 2