In the interest of getting the CHANGES worked out sooner or later I will try to (with the eager help of members of this conferance) work out at least one undescribed entry in the CHANGES per day. Depending on current level of boredom there might be more than one entry in a day.
1st entry:
basetype()
Suggested entry, added to "Language additions":
o basetype(foo) Returns the basic type of foo as opposed to typeof(foo) that returns the full type. Also available as sprintf("%t", foo).
Actually sprintf("%t",x) gets converted to basetype(x) internally as an optimization, if anyone cared to know. The comparision to typeof isn't all that good, since basetype returns a string while typeof returns a type.
constant tre = typeof(3); tre fyra=4;
Compiler Error: 1:Bad type in assignment. Compiler Error: 1:Expected: { tre = int(3..3) } Compiler Error: 1:Got : int(4..4)
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 20:31: Subject: CHANGES line of the day
In the interest of getting the CHANGES worked out sooner or later I will try to (with the eager help of members of this conferance) work out at least one undescribed entry in the CHANGES per day. Depending on current level of boredom there might be more than one entry in a day.
1st entry:
basetype()
Suggested entry, added to "Language additions":
o basetype(foo) Returns the basic type of foo as opposed to typeof(foo) that returns the full type. Also available as sprintf("%t", foo).
/ Peter Bortas
o basetype(foo) Returns a string with the basic type of foo as opposed to typeof(foo) that returns the actual type. Also available as sprintf("%t", foo).
?
/ Peter Bortas
Previous text:
2002-11-28 20:36: Subject: CHANGES line of the day
Actually sprintf("%t",x) gets converted to basetype(x) internally as an optimization, if anyone cared to know. The comparision to typeof isn't all that good, since basetype returns a string while typeof returns a type.
constant tre = typeof(3); tre fyra=4;
Compiler Error: 1:Bad type in assignment. Compiler Error: 1:Expected: { tre = int(3..3) } Compiler Error: 1:Got : int(4..4)
/ Martin Nilsson (hehe Torgny)
Suggestions still taken for that one. A few now ones for review:
o String.Elite Contains methods that transfer ordinary readable test into leet-speak. A failry good argument could be laid out for putting this in Crypto as a one way chiffer... o String.Buffer A buffer used for building strings very fast. o String.HTML Contains methods that help in generating HTML. o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert ints into diffrent string representation, and expand_tabs, which converts tabs to spaces.
/ Peter Bortas
Previous text:
2002-11-28 20:43: Subject: CHANGES line of the day
2nd entry:
it is possible to change predefines without forking a new pike
add_predefine/remove_predefine
Suggested entry:
o ? ????
/ Peter Bortas
Fine, except that I don't think "chiffer" is an English word at all.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-12-05 21:24: Subject: CHANGES line of the day
Suggestions still taken for that one. A few now ones for review:
o String.Elite Contains methods that transfer ordinary readable test into leet-speak. A failry good argument could be laid out for putting this in Crypto as a one way chiffer... o String.Buffer A buffer used for building strings very fast. o String.HTML Contains methods that help in generating HTML. o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert ints into diffrent string representation, and expand_tabs, which converts tabs to spaces.
/ Peter Bortas
I guess it's supposed to be cipher. (Unless I'm mistaken, I'm somewhat uncertain about the spelling of that word.)
/ Per Hedbor ()
Previous text:
2002-12-05 21:26: Subject: CHANGES line of the day
Fine, except that I don't think "chiffer" is an English word at all.
/ Martin Stjernholm, Roxen IS
Right. Feel free to suggest a synonym. Crypto two times in that one sentence doesn't look good.
o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert ints into different string representation, and expand_tabs, which converts tabs to spaces.
o String.Elite Contains methods that transfer ordinary readable test into leet-speak. A fairly good argument could be laid out for putting this in Crypto as a one way crypto...
o String.Buffer A buffer used for building strings very fast.
o String.HTML Contains methods that help in generating HTML.
/ Peter Bortas
Previous text:
2002-12-05 21:26: Subject: CHANGES line of the day
Fine, except that I don't think "chiffer" is an English word at all.
/ Martin Stjernholm, Roxen IS
replace(zinotext, ([ "test":"text", "failry":"fairly", "chiffer":"cipher", "representation":"representations", "ints":"integers", "diffrent":"different", ])
eller så.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-05 21:24: Subject: CHANGES line of the day
Suggestions still taken for that one. A few now ones for review:
o String.Elite Contains methods that transfer ordinary readable test into leet-speak. A failry good argument could be laid out for putting this in Crypto as a one way chiffer... o String.Buffer A buffer used for building strings very fast. o String.HTML Contains methods that help in generating HTML. o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert ints into diffrent string representation, and expand_tabs, which converts tabs to spaces.
/ Peter Bortas
At least I got most of them myself. :-/
o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert integers into different string representation, and expand_tabs, which converts tabs to spaces.
o String.Elite Contains methods that transfer ordinary readable text into leet-speak. A fairly good argument could be laid out for putting this in Crypto as a one way cipher...
o String.Buffer A buffer used for building strings very fast.
o String.HTML Contains methods that help in generating HTML.
/ Peter Bortas
Previous text:
2002-12-05 21:30: Subject: CHANGES line of the day
replace(zinotext, ([ "test":"text", "failry":"fairly", "chiffer":"cipher", "representation":"representations", "ints":"integers", "diffrent":"different", ])
eller så.
/ Martin Nilsson (hehe Torgny)
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-05 21:32: Subject: CHANGES line of the day
At least I got most of them myself. :-/
o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert integers into different string representation, and expand_tabs, which converts tabs to spaces.
o String.Elite Contains methods that transfer ordinary readable text into leet-speak. A fairly good argument could be laid out for putting this in Crypto as a one way cipher...
o String.Buffer A buffer used for building strings very fast.
o String.HTML Contains methods that help in generating HTML.
/ Peter Bortas
String.int2size is probably one of the most-duplicated functionality in Pike (i.e everyone has their own version).
/ David Hedbor
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
Well, now everyone can be annoyed that mine doesn't work exactly as theirs.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-05 21:40: Subject: CHANGES line of the day
String.int2size is probably one of the most-duplicated functionality in Pike (i.e everyone has their own version).
/ David Hedbor
Incheckat.
Why is there no extracted documentation for Protocols.SNMP on pike.ida.liu.se?
/ Peter Bortas
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
Let's take a few more easy ones. For review:
o Protocols.XMLRPC Implements most features of the XML-RPC standard
o Parser Added a few methods: get_xml_parser, which returns a Parser.HTML set up to parse XML, parse_html_entities and decode_numeric_xml_entity, which decode XML and HTML entities respectively.
Examples: Parser.decode_numeric_xml_entity("#x7a") => "z" Parser.parse_html_entities(">") => ">"
o Web.Crawler A generic asynchronus web crawler that supports the /robots.txt standard.
/ Peter Bortas
Previous text:
2002-12-05 21:43: Subject: CHANGES line of the day
Incheckat.
Why is there no extracted documentation for Protocols.SNMP on pike.ida.liu.se?
/ Peter Bortas
One should probably find out exactly how much of XMLRPC that is/isn't supported.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-05 22:20: Subject: CHANGES line of the day
Let's take a few more easy ones. For review:
o Protocols.XMLRPC Implements most features of the XML-RPC standard
o Parser Added a few methods: get_xml_parser, which returns a Parser.HTML set up to parse XML, parse_html_entities and decode_numeric_xml_entity, which decode XML and HTML entities respectively.
Examples: Parser.decode_numeric_xml_entity("#x7a") => "z" Parser.parse_html_entities(">") => ">"
o Web.Crawler A generic asynchronus web crawler that supports the /robots.txt standard.
/ Peter Bortas
After writing some code similar to int2size, I'll suggest that it either skips the unit, and/or takes an additional argument that is the unit. E.g.
int2size(4200, "bps") ==> 4.1 Kbps
Perhaps one should have one function that produces 2^10 prefixes, and another one that produces standard SI (or whatever the stanrd is) prefixes. The latter function could take floats rather than ints, though. Like
foo(0.01, "s") => 10 ms
Or perhaps that gets a little too complicated, e.g. one would also want to provide the precision. Perhaps something for sprintf.
/ Niels Möller ()
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
Just a note: Bits per seconds is usually counted in units of 1000, not 1024. Thus it should probably be 4.2 kbps.
/ Per Hedbor ()
Previous text:
2002-12-05 22:28: Subject: CHANGES line of the day
After writing some code similar to int2size, I'll suggest that it either skips the unit, and/or takes an additional argument that is the unit. E.g.
int2size(4200, "bps") ==> 4.1 Kbps
Perhaps one should have one function that produces 2^10 prefixes, and another one that produces standard SI (or whatever the stanrd is) prefixes. The latter function could take floats rather than ints, though. Like
foo(0.01, "s") => 10 ms
Or perhaps that gets a little too complicated, e.g. one would also want to provide the precision. Perhaps something for sprintf.
/ Niels Möller ()
In the last episode (Dec 05), Niels Mller () @ Pike (-) developers forum said:
After writing some code similar to int2size, I'll suggest that it either skips the unit, and/or takes an additional argument that is the unit. E.g.
int2size(4200, "bps") ==> 4.1 Kbps
Perhaps one should have one function that produces 2^10 prefixes, and another one that produces standard SI (or whatever the stanrd is) prefixes. The latter function could take floats rather than ints, though. Like
foo(0.01, "s") => 10 ms
Or perhaps that gets a little too complicated, e.g. one would also want to provide the precision. Perhaps something for sprintf.
I think you've found the reason everyone writes their own. By the time you come up with a function that satisfies everyone, it'll have 6 arguments and no-one will bother to use it because it's too complicated :)
Perhaps that could be solved by feeding the function a constant object or mapping. Something like:
int2size(2048, Foo.BYTES_SIZE_BIN) => "2 KiB" int2size(2048, Foo.BYTES_SIZE_BIN_OLD) => "2 kb" int2size(2000, Foo.BITS_RATE_DEC) => "2 kbps" int2size(17, ([ "unit": " pellefanter", "foo_per_unit": 16, "precision": 17 )] ) => "1.0625 pellefanter"
That way I would at least use the int2size function as a base when building my own.
/ Peter Bortas
Previous text:
2002-12-05 22:38: Subject: Re: CHANGES line of the day
In the last episode (Dec 05), Niels Mller () @ Pike (-) developers forum said:
After writing some code similar to int2size, I'll suggest that it either skips the unit, and/or takes an additional argument that is the unit. E.g.
int2size(4200, "bps") ==> 4.1 Kbps
Perhaps one should have one function that produces 2^10 prefixes, and another one that produces standard SI (or whatever the stanrd is) prefixes. The latter function could take floats rather than ints, though. Like
foo(0.01, "s") => 10 ms
Or perhaps that gets a little too complicated, e.g. one would also want to provide the precision. Perhaps something for sprintf.
I think you've found the reason everyone writes their own. By the time you come up with a function that satisfies everyone, it'll have 6 arguments and no-one will bother to use it because it's too complicated :)
-- Dan Nelson dnelson@allantgroup.com
/ Brevbäraren
(Yes, I realise that the among other things the unit key has to be a bit more advanced. A function would probably be best, but you get the picture.)
/ Peter Bortas
Previous text:
2002-12-05 22:51: Subject: Re: CHANGES line of the day
Perhaps that could be solved by feeding the function a constant object or mapping. Something like:
int2size(2048, Foo.BYTES_SIZE_BIN) => "2 KiB" int2size(2048, Foo.BYTES_SIZE_BIN_OLD) => "2 kb" int2size(2000, Foo.BITS_RATE_DEC) => "2 kbps" int2size(17, ([ "unit": " pellefanter", "foo_per_unit": 16, "precision": 17 )] ) => "1.0625 pellefanter"
That way I would at least use the int2size function as a base when building my own.
/ Peter Bortas
String.int2size(4200);
(4) Result: "4.1 kb"
Would a few more arguments to this one hurt? Like if one would like to use 1000 or 1024, what prefixes (a,f,p,n,µ,m - k, M, G, T, P, E) and suffix to use.
/ Sten (Android) Eriksson (of Borg)
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
*Gives Sten a blackboard and a white chalk*
/ Peter Bortas
Previous text:
2002-12-05 23:00: Subject: CHANGES line of the day
String.int2size(4200);
(4) Result: "4.1 kb"
Would a few more arguments to this one hurt? Like if one would like to use 1000 or 1024, what prefixes (a,f,p,n,µ,m - k, M, G, T, P, E) and suffix to use.
/ Sten (Android) Eriksson (of Borg)
String.int2size(4200);
(4) Result: "4.1 kb"
Uh, no. 4200 is 4.2k, or 4.1K. Not 4.1k.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Man kan också lägga till under String
Examples:
String.int2char(42);
(1) Result: "*"
String.int2hex(42);
(2) Result: "2a"
String.int2roman(42);
(3) Result: "XLII"
String.int2size(4200);
(4) Result: "4.1 kb"
/ Martin Nilsson (hehe Torgny)
Not according to the person who made the sizetostring in roxenlib, from where the function was stolen.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-06 00:22: Subject: CHANGES line of the day
String.int2size(4200);
(4) Result: "4.1 kb"
Uh, no. 4200 is 4.2k, or 4.1K. Not 4.1k.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Unless it was written by God, it is not necessary to assume that the author is infallible.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-06 00:29: Subject: CHANGES line of the day
Not to my knowledge, but the answer might be revealed by cvs annotate.
/ Martin Nilsson (hehe Torgny)
And then only because he has a very good PR department.
/ Peter Bortas
Previous text:
2002-12-06 00:30: Subject: CHANGES line of the day
Unless it was written by God, it is not necessary to assume that the author is infallible.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Or *shudder* 4.1kib.
Can't we get sprintf to do 'k','m','µ' (ki, K, G) etc prefixes? My calculator had it as an option to "e" and "g" modes. It would be much more useful.
/ Mirar
Previous text:
2002-12-06 00:22: Subject: CHANGES line of the day
String.int2size(4200);
(4) Result: "4.1 kb"
Uh, no. 4200 is 4.2k, or 4.1K. Not 4.1k.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Feel free to move Elite to Crypto any time :)
(But then it might need to be made streaming to fit in?)
/ Mirar
Previous text:
2002-12-05 21:32: Subject: CHANGES line of the day
At least I got most of them myself. :-/
o String Added a few new methods: int2char, int2hex, int2roman, int2size, which convert integers into different string representation, and expand_tabs, which converts tabs to spaces.
o String.Elite Contains methods that transfer ordinary readable text into leet-speak. A fairly good argument could be laid out for putting this in Crypto as a one way cipher...
o String.Buffer A buffer used for building strings very fast.
o String.HTML Contains methods that help in generating HTML.
/ Peter Bortas
No, I feel comfortable having it in String. It just an attempt at some perhaps dry humor. :-P
/ Peter Bortas
Previous text:
2002-12-05 21:34: Subject: CHANGES line of the day
Feel free to move Elite to Crypto any time :)
(But then it might need to be made streaming to fit in?)
/ Mirar
You probably should compare with _typeof() and not typeof().
/ Henrik Grubbström (Lysator)
Previous text:
2002-11-28 20:38: Subject: CHANGES line of the day
o basetype(foo) Returns a string with the basic type of foo as opposed to typeof(foo) that returns the actual type. Also available as sprintf("%t", foo).
?
/ Peter Bortas
If it works the same as sprintf("%t"...) then it will call the _sprintf lfun instead of giving the true basic type for objects. Since most _sprintf's returns a %O-like string regardless of the flag, it doesn't quite fulfill this purpose. This can probably be debated, but I think it'd be more useful if basetype() wasn't possible to fool with _sprintf.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-28 20:38: Subject: CHANGES line of the day
o basetype(foo) Returns a string with the basic type of foo as opposed to typeof(foo) that returns the actual type. Also available as sprintf("%t", foo).
?
/ Peter Bortas
Looking at the code, how can you manage to feed it with something so that it returns "lvalue", "zero", "void", or "mapping_data"?
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 22:35: Subject: CHANGES line of the day
If it works the same as sprintf("%t"...) then it will call the _sprintf lfun instead of giving the true basic type for objects. Since most _sprintf's returns a %O-like string regardless of the flag, it doesn't quite fulfill this purpose. This can probably be debated, but I think it'd be more useful if basetype() wasn't possible to fool with _sprintf.
/ Martin Stjernholm, Roxen IS
Simply add another argument to signal that you want to skip the (explicit, I might add) _sprintf-call.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 22:35: Subject: CHANGES line of the day
If it works the same as sprintf("%t"...) then it will call the _sprintf lfun instead of giving the true basic type for objects. Since most _sprintf's returns a %O-like string regardless of the flag, it doesn't quite fulfill this purpose. This can probably be debated, but I think it'd be more useful if basetype() wasn't possible to fool with _sprintf.
/ Martin Stjernholm, Roxen IS
Another argument where?
Of course it's explicit - it's used for the %t flag, and it's clearly correct in that case. But a separate basetype() function has no obvious business calling _sprintf.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-28 22:43: Subject: CHANGES line of the day
Simply add another argument to signal that you want to skip the (explicit, I might add) _sprintf-call.
/ Martin Nilsson (hehe Torgny)
Another argument to basetype. string basetype(mixed jox, void|int(0..1) call_sprintf);
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 22:52: Subject: CHANGES line of the day
Another argument where?
Of course it's explicit - it's used for the %t flag, and it's clearly correct in that case. But a separate basetype() function has no obvious business calling _sprintf.
/ Martin Stjernholm, Roxen IS
Doesn't seem to be committed (in builtin.cmod). But I agree with Per that it's better to just use sprintf("%t"...) if that is what you want.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-28 22:55: Subject: CHANGES line of the day
Another argument to basetype. string basetype(mixed jox, void|int(0..1) call_sprintf);
/ Martin Nilsson (hehe Torgny)
No, it's not committed. I suggested that you add that so that one can have a basetype function that doesn't call _sprintf. Calling sprintf("%t",x) doesn't solve that, since it calls _sprintf.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 22:57: Subject: CHANGES line of the day
Doesn't seem to be committed (in builtin.cmod). But I agree with Per that it's better to just use sprintf("%t"...) if that is what you want.
/ Martin Stjernholm, Roxen IS
*Doh!* basetype() would never call _sprintf, of course. sprintf("%t"...) would always do it.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-28 23:01: Subject: CHANGES line of the day
No, it's not committed. I suggested that you add that so that one can have a basetype function that doesn't call _sprintf. Calling sprintf("%t",x) doesn't solve that, since it calls _sprintf.
/ Martin Nilsson (hehe Torgny)
Yes, that is a better solution, but not what I suggested. (The Stensonian quest for clearity)
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 23:04: Subject: CHANGES line of the day
*Doh!* basetype() would never call _sprintf, of course. sprintf("%t"...) would always do it.
/ Martin Stjernholm, Roxen IS
An _sprintf that ignores the format specifier is broken, IMO.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-11-28 22:35: Subject: CHANGES line of the day
If it works the same as sprintf("%t"...) then it will call the _sprintf lfun instead of giving the true basic type for objects. Since most _sprintf's returns a %O-like string regardless of the flag, it doesn't quite fulfill this purpose. This can probably be debated, but I think it'd be more useful if basetype() wasn't possible to fool with _sprintf.
/ Martin Stjernholm, Roxen IS
Sounds like about as much work as fixing them instead. I can look through the pike code if you inspect the C-code...
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 22:50: Subject: CHANGES line of the day
That's bad. We should not have broken functions in Pike. Can you make a list?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Ok. Just replace
return whatever;
with
return fmt == 'O' && whatever;
Simple and does the trick.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-11-28 22:52: Subject: CHANGES line of the day
Sounds like about as much work as fixing them instead. I can look through the pike code if you inspect the C-code...
/ Martin Nilsson (hehe Torgny)
I'm a bit dissapointed that sprintf("%t(%O)", this_program, something) in _sprintf didn't turn out good.
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-28 23:00: Subject: CHANGES line of the day
Ok. Just replace
return whatever;
with
return fmt == 'O' && whatever;
Simple and does the trick.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Use `sprintf("%O(%O)", this_program, something)' instead.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-11-28 23:24: Subject: CHANGES line of the day
I'm a bit dissapointed that sprintf("%t(%O)", this_program, something) in _sprintf didn't turn out good.
/ Martin Nilsson (hehe Torgny)
I'm done. Total number of _sprintf functions updated: 17 (half of them in the GTK module).
As an extra bonus, I fixed a bug in the Gmp.mpq _sprintf function which caused the number to be printed *10 if formatted as a float... :-)
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-11-28 22:52: Subject: CHANGES line of the day
Sounds like about as much work as fixing them instead. I can look through the pike code if you inspect the C-code...
/ Martin Nilsson (hehe Torgny)
Hmm. This might take a while...
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-29 00:48: Subject: CHANGES line of the day
I'm done. Total number of _sprintf functions updated: 17 (half of them in the GTK module).
As an extra bonus, I fixed a bug in the Gmp.mpq _sprintf function which caused the number to be printed *10 if formatted as a float... :-)
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
[nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.BMP);' Image.0() [nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.PNG);' -()->0() [nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.GIF);' _Image_GIF
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-11-29 00:48: Subject: CHANGES line of the day
I'm done. Total number of _sprintf functions updated: 17 (half of them in the GTK module).
As an extra bonus, I fixed a bug in the Gmp.mpq _sprintf function which caused the number to be printed *10 if formatted as a float... :-)
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
That is unrelated to what you are commenting, since those modules don't have _sprintf functions.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-03 22:53: Subject: CHANGES line of the day
[nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.BMP);' Image.0() [nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.PNG);' -()->0() [nilsson@m222 7.3]$ pike -e 'write("%O\n", Image.GIF);' _Image_GIF
/ Martin Nilsson (hehe Torgny)
It's related to its supertopic: sprintf("%O") output. It worked better in Pike 7.3.60 btw...
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-03 23:27: Subject: CHANGES line of the day
That is unrelated to what you are commenting, since those modules don't have _sprintf functions.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Didn't it just say "object" in 7.3.60? That's about as informative as "-()->0()" and slightly less informative than "Image.0()".
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-03 23:31: Subject: CHANGES line of the day
It's related to its supertopic: sprintf("%O") output. It worked better in Pike 7.3.60 btw...
/ Martin Nilsson (hehe Torgny)
No.
[nilsson@m222 icons]$ /usr/local/pike/7.3.60/bin/pike -e 'write("%O\n", Image.BMP);' Image.BMP
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-03 23:44: Subject: CHANGES line of the day
Didn't it just say "object" in 7.3.60? That's about as informative as "-()->0()" and slightly less informative than "Image.0()".
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Hm, interresting. I wonder where that string came from. *investigates*
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-03 23:51: Subject: CHANGES line of the day
No.
[nilsson@m222 icons]$ /usr/local/pike/7.3.60/bin/pike -e 'write("%O\n", Image.BMP);' Image.BMP
/ Martin Nilsson (hehe Torgny)
Ok, problem located. It seems like mast got a little carried away with his "Fixed proper testing of objects in more places", and fixed an improper test of objects in describe_object().
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-03 23:54: Subject: CHANGES line of the day
Hm, interresting. I wonder where that string came from. *investigates*
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Oops, sorry. I even spotted the same object|program case in the function above and got it correct there. Must've been late.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-12-04 15:31: Subject: CHANGES line of the day
Ok, problem located. It seems like mast got a little carried away with his "Fixed proper testing of objects in more places", and fixed an improper test of objects in describe_object().
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Yes, I used the pattern from the function above to fix it. That took care of the problem at hand, and I'm assuming it was the RTTD in any case.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-12-04 19:38: Subject: CHANGES line of the day
Oops, sorry. I even spotted the same object|program case in the function above and got it correct there. Must've been late.
/ Martin Stjernholm, Roxen IS
Actually "object" is more informative than "-()->0()", since the latter depends on where the compilation occurs and thus is disinformative. There is no class "0" in the HilfeInput class, so this is a lie:
Pike v7.3 release 62 running Hilfe v3.5 (Incremental Pike Frontend)
Image.PNG;
(1) Result: HilfeInput()->0()
/ Martin Nilsson (hehe Torgny)
Previous text:
2002-12-03 23:44: Subject: CHANGES line of the day
Didn't it just say "object" in 7.3.60? That's about as informative as "-()->0()" and slightly less informative than "Image.0()".
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
There should be different lfuns for different purposes. If there were an lfun _debug_format or similar which only is called for %O (and perhaps in other similar cases), this _sprintf sloppiness wouldn't have become a problem. The by far most common use for _sprintf is for that purpose only, so a separate lfun for that seems reasonable.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-28 22:48: Subject: CHANGES line of the day
An _sprintf that ignores the format specifier is broken, IMO.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
How about... nameof?
/ David Hedbor
Previous text:
2002-11-28 23:02: Subject: CHANGES line of the day
There should be different lfuns for different purposes. If there were an lfun _debug_format or similar which only is called for %O (and perhaps in other similar cases), this _sprintf sloppiness wouldn't have become a problem. The by far most common use for _sprintf is for that purpose only, so a separate lfun for that seems reasonable.
/ Martin Stjernholm, Roxen IS
pike-devel@lists.lysator.liu.se