REBOL Technologies

Additions to New-Line Function

Carl Sassenrath, CTO
REBOL Technologies
6-Dec-2004

Article #0059
Main page || Index || Prior Article [0058] || Next Article [0060] || Post Comments || Send feedback

As part of REBOL/Services implementation, I needed a better way to store things like user authentication records within text file format. So, in 2.5.57, the NEW-LINE function (that controls the line markers within blocks) has been updated with two new refinements: /all and /skip.

The /all will apply the specified option to all the values in the block

The /skip will apply the specified option for the skip value, and the inverted option for the non-skip values.

The code below shows these enhancements:

>> block: [1 2 3 4 5 6]
== [1 2 3 4 5 6]
>> new-line/all block on
== [
    1
    2
    3
    4
    5
    6
]
>> new-line/all block off
== [1 2 3 4 5 6]
>> new-line/skip block on 2
== [
    1 2
    3 4
    5 6
]
>> new-line/skip block on 3
== [
    1 2 3
    4 5 6
]

Also notice that the ending ] character is back to where it should be on 2.5.57. See RAMBO.

Post Comments

Updated 23-Nov-2024   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code