Proposal: Formatting: spaces in data type symbols

Accepted

This page is dedicated to discussing this specific proposal

ContributeContributions

ruvavatar of ruv [250] Formatting: spaces in data type symbolsProposal2022-08-12 15:04:29

Author

Ruv

Change Log

  • 2022-08-12 Initial version

Problem

In Forth-94 no data type symbol contain a space. In Forth-2012 some data type symbols contain spaces, so stack diagrams are worse read.

Some examples

Forth-94

( i*x xt -- j*x )
( n1|u1 n2|u2 -- n3|u3 ) 

Forth-2012

( i * x xt -- j * x )
( n1 | u1 n2 | u2 -- n3 | u3 ) 

Solution

Remove spaces from data type symbols.

Proposal

Everywhere in the text of the standard replace u | n, u_ | n_, i * x, j * x, k * x by u|n, u_|n_, i*x, j*x, k*x correspondingly.

ruvavatar of ruv

Additional reasonings.

  1. According to data type symbols, u|n is a single data type symbol. It's confusing when this data type symbol contains spaces, when most data type symbols don't contain spaces. The same is true for i*x, etc.

  2. A bar character | is also used to represent alternates for the whole tuple of stack-parameter data types; for example see FIND ( c-addr -- c-addr 0 | xt 1 | xt -1 ). If we represent u|n as u | n (i.e, with spaces around the bar), it looks like alternative for the whole tuple of data types, but it's wrong.

Formal

ruvavatar of ruv

It's an editorial issue.

In the source it looks as:

\item \stack{n_1|u_1 n_2|u_2}{n_3|u_3}

I.e., no additional spaces around a bar in the data type symbols like n_1|u_1.

AntonErtlavatar of AntonErtl

This was accepted with vote #30 10Y:0:1A after the 2022 meeting.

Accepted
Reply New Version