Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

As Will Rogers would have said, "There is no such things as a free variable."


devel / comp.lang.apl / ⎕FMT Wish List

SubjectAuthor
o ⎕FMT_Wish_ListBrian McGuinness

1
⎕FMT Wish List

<5fdac57c-6dc8-437c-9f6c-dde1c904cfffn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=358&group=comp.lang.apl#358

  copy link   Newsgroups: comp.lang.apl
X-Received: by 2002:a37:695:0:b0:69f:b916:2d8e with SMTP id 143-20020a370695000000b0069fb9162d8emr10734782qkg.680.1652661607001;
Sun, 15 May 2022 17:40:07 -0700 (PDT)
X-Received: by 2002:a81:8584:0:b0:2fb:33c2:3a41 with SMTP id
v126-20020a818584000000b002fb33c23a41mr17493556ywf.176.1652661606770; Sun, 15
May 2022 17:40:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.apl
Date: Sun, 15 May 2022 17:40:06 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=71.250.213.89; posting-account=h3IwYwoAAAAeE2lWQnRSCqcQ0dO-KDvQ
NNTP-Posting-Host: 71.250.213.89
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5fdac57c-6dc8-437c-9f6c-dde1c904cfffn@googlegroups.com>
Subject: ⎕FMT_Wish_List
From: b.mcguinness747@gmail.com (Brian McGuinness)
Injection-Date: Mon, 16 May 2022 00:40:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Brian McGuinness - Mon, 16 May 2022 00:40 UTC

O modifier:
Allow the number to be omitted, in which case it defaults to zero.

Allow the replacement text to be omitted, in which case it defaults to zero.

Now 'O' by itself causes zeroes to be replaced with blanks, as 'B' does now. This moves all of the number replacements under the same modifier, 'O', and frees up 'B' for another use.

B modifier:
The new syntax is Bn, where n is an integer from 2 to 16 specifying the radix to display an integer value in. This applies to the 'I' and 'G' formats. The letters from 'A' to 'F' are normally used for "digits" from 10 to 15, but this can be changed by using the 'S' modifier, e.g. S<AaBbCcDdEeFf> for base 16 or S<ATBE> for base 12.

C modifier:
Allow an optional integer to follow the 'C' to specify the spacing of the commas (e.g. C4 separates groups of 4 digits). The default spacing is 3. This is useful when the radix is not 10, e.g. 'C4B16I'

G format:
Add the concept of a "stop character." Filling in a 'G' format spec from right to left, when a stop character is encountered it is not inserted in the output. Instead, it serves as a marker. If there are no more digits left to insert, everything to the left of the stop character is converted to blanks. The stop character may appear in multiple places in the format spec. The default stop character is '?', but this can be changed by the 'S' modifier. For example:

NARS2000:

'G<(ZZZ) 999-9999>' ⎕FMT 1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901
( 000 0001
( 000 0012
( 000 0123
( 000 1234
( 001-2345
( 012-3456
( 123-4567
( 1) 234-5678
( 12) 345-6789
(123) 456-7890
**************

Using '?' as a stop character, and including all background text that is surrounded by digits:

'G<(ZZZ) ?999-9999>' ⎕FMT 1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901
000-0001
000-0012
000-0123
000-1234
001-2345
012-3456
123-4567
( 1) 234-5678
( 12) 345-6789
(123) 456-7890
**************

V (variable) format:
This proposed new format would be similar to Fortran G format of C printf() "%g". Since the letter 'G' is already in use, I propose using 'V' instead. The idea is that fixed point output is more intuitively meaningful than scientific notation, since the number of digits to the left of the decimal point or the number of leading zeroes to the right immediately gives a sense of the size of the number. But if the number won't fit in the field in fixed point notation, using scientific notation is infinitely preferable to displaying a meaningless row of asterisks.

= modifier:
This is like 'L', but instead of left-justifying the number in the field it centers the number in the field.

Other changes:

Omitting the field width from a format spec causes ⎕FMT to use the minimum field with that would allow the contents of the corresponding column of data to fit.

All relevant modifiers (such as C, K, M, N, O, P, Q) are taken into account when calculating this width.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor