[DGD] Re: A few questions regarding some kfuns....

Gregory D Lewis glewis at maths.adelaide.edu.au
Thu Sep 17 04:33:37 CEST 1998


> Another question regarding kfuns is the kfun parse_string.  Does anybody
> know (Mr. Dworkin ??) if and when this kfun will be added and what exactly
> its functionality will be?  And then, for the last question, would it be
> hard to write a extra kfun package or add a kfun sprintf?  I guess the DGD
> driver is still mainly used for text based games, so a text formatting kfun
> would be very nice.

Do you feel you absolutely need a kfun version of sprintf?  If not, then

ftp://ftp.lysator.liu.se/pub/lpmud/drivers/dgd/lpc/sprintf-1.3.tgz

is a sprintf package written by Abigail in LPC.

Reminds me, I need to add LPC package information to the FAQ.

There is also an NFS package in the same directory.  Does anyone know where
one can currently get the LPC implementation of tar?

Personally, I believe the printf family of functions is the wrong paradigm
for an OO language.  You might end up happier in the long run if you write
a formatting object.  Unfortunately the code may not be as pretty as you'd
like with the inability to overload functions, i.e. you'd probably like to
have the functions

string format(int foo) { ... }
string format(float foo) { ... }
etc.

instead of

string format(mixed foo) { switch (typeof(foo)) { ... } }

but you can't unfortunately (or fortunately depending on your view point :)
However, some of the internal sprintf code would be useful in writing the
internals of such a formatting object, so its probably worth downloading 
anyway.

-- 
Greg Lewis                              Applied Maths Department
Email : glewis at maths.adelaide.edu.au    University of Adelaide
--
Do not drink coffee in early A.M.  It will keep you awake until noon.



List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list