Re: sprintf() query

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

First, I noticed that the printf() docs do not state the third argument is optional (since 4.1)

just slow in rewriting the docs!

petelomax said...

Given that printf(1,"hi") is now legal, is there any case for sprintf("hi") to be legal as well - offhand I cannot think of any, which is why I am asking.

Pete

Everything should work and look the same. A language is simple only if there are no surprises. So sprintf("hi") must work the same as printf. The slow doc writers job is easier; the language designer's job is also easier because there is a pattern to follow.

I still have questions like:

  • should the first argument be "output direction", when it is almost always "1" ?
  • should an output routine be able to output utf32 content to a utf8 terminal?
  • can the Phix string allow for a universal output routine that shows text and numbers "as expected"?
  • is it possible to create a new set of output routines that breaks from the DOS legacy?

_tom

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu