Proposal: A easy visual separator

Informal

This page is dedicated to discussing this specific proposal

ContributeContributions

agsbavatar of agsb [408] A easy visual separatorProposal2025-08-24 15:44:45

Author:

Alvaro Gomes Sobral Barcellos

Change Log:

none

Problem:

In word definitions, component words form sets with specific purposes. These groups can be more visually highlighted using something as bullet points.

Solution:

Use a word pipe : | ;

Typical use: (Optional)

: CATCH | SP@ >R | HANDLER @ >R | RP@ HANDLER ! | EXECUTE | R> HANDLER ! | R> DROP | 0 ;

Proposal:

The pipe ( | ) separates conjunts of words, grouped in blocks for easy visualisation and could serve as place holder for actions while debug.

Reference implementation:

: | ;

Testing: (Optional)

AntonErtlavatar of AntonErtl

The existing practice is to use newline or multiple spaces for visual separation. The latter for your example:

: CATCH   SP@ >R   HANDLER @ >R   RP@ HANDLER !   EXECUTE   R> HANDLER !   R> DROP   0 ;

EricBlakeavatar of EricBlake

https://forth-standard.org/standard/locals/bColon already uses | as part of {: during locals; using it for more than one purpose may be confusing.

Reply New Version