Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2789

Re: EE or CS?

From BGB <cr88192@hotmail.com>
Newsgroups comp.programming
Subject Re: EE or CS?
Date 2013-01-10 18:25 -0600
Organization albasani.net
Message-ID <kcnm9e$le8$1@news.albasani.net> (permalink)
References (11 earlier) <SJdHs.469$2e1.31@fx04.fr7> <kcll2j$6vs$1@news.albasani.net> <SqyHs.1391$T67.1204@fx05.fr7> <kcn8d3$phv$1@news.albasani.net> <CQGHs.1970$k04.1034@fx20.fr7>

Show all headers | View raw


On 1/10/2013 3:58 PM, BartC wrote:
> "BGB" <cr88192@hotmail.com> wrote in message
> news:kcn8d3$phv$1@news.albasani.net...
>> On 1/10/2013 6:04 AM, BartC wrote:
>
>>> Even so, why choose a designation that is generally regarded as a valid
>>> decimal number in most other contexts?
>
>> putting 0 in front of numbers naturally results in evilness though, so
>> why
>> do it?...
>
> It *will* be evil if it changes the value of the number!
>

that is part of why it is a bad idea not to put 0 in front of numbers...


thinking of it, did go and changed it to '0o', partly as personally I 
have hardly ever used octal for much of anything (and none of my 
existing script code uses octal).


>> most common I think is to pad and align numbers with spaces.
>
> That's true, but the language shouldn't really dictate number style.
> Leading
> zeros on decimals can be useful in a few situations, for the same sorts of
> reasons that they are useful in binary and hex: to delimit the number of
> digits more clearly, for example, or to highlight a pattern in the digits.
> Whatever. Making it mean octal isn't so useful!
>
> And the main point is, with octal being so rare, it can also cause
> unexpected bugs.
>
>> granted, yes, maybe "0o1234" or similar would be better.
>
> Or perhaps 8x1234, otherwise, written as 0O1234, it can look confusing.
>
> (For octal, I use either 1234x8, or 1234O, but that latter can also be
> written 1234'O. I doubt that will ever be used though.)
>

"0o1234" would follow the same pattern as "0x1234" and "0b1010".

"0O1234" wont be recognized by the parser (since only 'o' is recognized).

"0c1234" is also possible (OcTAL).

I guess "0d..." could be added for orthogonality, then:
0bXXXX: binary;
0cXXXX: octal;
0dXXXX: decimal;
0xXXXX: hex.

done, then was followed by some debugging due to stupid errors.

note, it is now possible to type things like:
"0d______69" and "0d00000069".

which will (amazingly) give the same value as... "69".

likewise: "-0d69".


in the process, noticed and fixed a few more bugs related to recent 
type-system changes (arithmetic unnecessarily promoting values to 
double...).


>>> These are just attributes, which are best used for appearance and style
>>> rather than completely changing the meaning of something. What next,
>>> colour?
>>>
>>
>> why not?...
>> (not being entirely serious here... but this is a logical extension...).
>
> If you want slow down productivity by an order of magnitude, then it's a
> great idea! However, the concept seems to work in colorForth.
>

ok.


the idea was originally related to the notion that in specifications, 
bold and italic are commonly used to express meaning as well.

it could be interesting if this were applied to programming languages.


the main downside though would be a matter of the editor, as it could 
couple the language with the text-editor used to write it.

one other possibility though could be that the actual code would be a 
type of lightweight markup, potentially a format vaguely similar to RTF 
or MediaWiki or similar, ...

say:
"This text is [b;bold] and [i;italic], and [u;underlined], or [c4;red]."
probably with an escape character somewhere (such as '\').

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

EE or CS? bob <bob@coolfone.comze.com> - 2013-01-08 09:28 -0800
  Re: EE or CS? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-08 10:41 -0800
  Re: EE or CS? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-01-08 21:41 +0100
    Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-01-08 20:50 +0000
      Re: EE or CS? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-01-08 22:25 +0100
        Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-01-08 21:35 +0000
          Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-08 22:51 +0000
            Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-01-08 23:23 +0000
              Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-08 23:31 +0000
                Re: EE or CS? Ian Collins <ian-news@hotmail.com> - 2013-01-09 12:58 +1300
                Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-01-09 01:35 +0000
                Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-09 02:13 +0000
                Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-01-09 11:28 +0000
                Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-09 12:51 +0000
                Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-09 23:52 -0600
                Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-10 12:04 +0000
                Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-10 14:28 -0600
                Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-10 21:58 +0000
                Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-10 18:25 -0600
                Re: EE or CS? Patricia Shanahan <pats@acm.org> - 2013-01-09 05:35 -0800
                Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-09 22:43 -0600
                Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-10 12:22 +0000
                Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-10 14:20 -0600
    Re: EE or CS? BGB <cr88192@hotmail.com> - 2013-01-09 22:15 -0600
  Re: EE or CS? Ian Collins <ian-news@hotmail.com> - 2013-01-09 10:19 +1300
  Re: EE or CS? "BartC" <bc@freeuk.com> - 2013-01-08 22:54 +0000
  Re: EE or CS? Robert Miles <robertmilesxyz@gmail.com> - 2013-01-12 16:26 -0800
  Re: EE or CS? Dan <dantex1@aol.com> - 2013-02-19 19:12 -0800
    Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-02-20 09:16 +0000
      Re: EE or CS? Dan <dantex1@aol.com> - 2013-02-20 18:59 -0800
        Re: EE or CS? Ian Collins <ian-news@hotmail.com> - 2013-02-21 16:40 +1300
          Re: EE or CS? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-02-21 11:45 +0100
          Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-02-21 11:45 +0000
        Re: EE or CS? Rui Maciel <rui.maciel@gmail.com> - 2013-02-21 07:36 +0000

csiph-web