From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder3.news.weretis.net!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Tue, 11 May 2010 17:05:07 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> Injection-Date: Tue, 11 May 2010 17:05:07 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="28153"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1997iZOm5myI4KpkPNkWs0B8j8EWqDMTrA=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:pVt7QLgPUxh+Nnj50uyt/4t6WS8= Xref: g2news2.google.com comp.lang.ada:11510 Date: 2010-05-11T17:05:07+00:00 List-Id: Dmitry A. Kazakov expounded in news:h1uzhgbbx6hd.1lg6oydcub0re$.dlg@40tude.net: > On Mon, 10 May 2010 18:50:02 +0000 (UTC), Warren wrote: > >> But you have no way to know when you've read >> a empty line in a lexer routine that is reading >> character by character. > > A lexer routine shall never do that. You either read lines and then > parse them, or else you do stream input and the line end is to be > determined by the lexer (i.e. by the language being parsed). Empty lines are significant to my parser, when the basic programs are unnumbered. I'm not going to articulate why here, but they were significant. I will buy the argument that perhaps I should be using a stream input. But that'll wait for some other day, as I have much bigger fish to fry at the moment. >>>> C of course did >>>> the same thing, except that they made formatting a string >>>> easier. >>> >>> Easier? It is untyped! >> >> No, no, no "said the fish as he lit to the Cat in the Hat". >> >> You exaggerate. It is not strongly typed like Ada, but >> by George, there are "types" in C. You can think of C >> differentiating on the basis of "base" types. > > I meant formatted I/O. That is strictly untyped, not weakly typed. If > you use dynamic lists of arguments, you have to be dynamically typed > or else untyped. C chose the latter. As I pointed out earlier, those *printf() arguments are checked, so it is not strictly untyped. You can lie to it of course.. >> I just cited >> one common and concrete formatting instance that gets >> used in C frequently, that you cannot do in Ada "out >> of the box". > > Luckily. As others already suggested, you should use type specific > operations like "&" for that. How does "&" fix the hexadecimal formatting? That is what I am discussing. > Surely there is a better way, that is what Ada stream I/O attributes > are. Unfortunately they are hard-coded, because the language lacks > multiple dispatch. So if Ada needed formatted I/O, there should be > similar attributes, e.g. S'Format(Output, X), S'Scan(Output). But it > does not worth the efforts. I'm not complaining about that. I'm complaining that (for example) the hex conversion is "annoying" in that I have to "wrap it" to get my "proper" hex output. Ada gives me the hex, but a bunch of enclosing junk with it. >> Yes, you >> can mess with proportional fonts if you like, but it isn't >> always that way. > > Nobody want to see fixed font output. Pardon me? If you give me a report of my investment holdings with columns of numbers, then those numbers better line in columns as well. Have you ever put code in a Word document? You don't leave them proportional, do you? Gak!! > Only if the output is improperly formatted. There is no application > for fixed point fonts other than for source code of a machine > language. That's just wrong. See above for one more example. Warren