REBOL3 tracker
  0.9.12 beta
Ticket #0002070 User: anonymous

Project:



rss
TypeWish Statusdismissed Date29-Sep-2013 17:03
Versionr3 master CategoryNative Submitted byfork
PlatformAll Severitymajor Prioritynormal

Summary add /ONLY refinement to PRINT, remove PRIN from core
Description The "making peace with /ONLY" push I propose is to teach it early and use it consistently. This explanation is, roughly phrased:

"Rebol tries to be literate and use full, unabbreviated words for operations. In some cases, empirically it is seen that the general use case for an operation involves wanting something more to be done than the minimum work that the operation might involve. One could use another word for the fundamental operation, but Rebol has a convention for a generalized suppressing refinement called /ONLY. The unusual name really means 'only do the more basic operation which this word represents'"

/ONLY refinements never add additional parameters to the invocation, and the language would not lose any expressive power or abilities if the function could only be invoked in its /ONLY form.

PRINT is a very good introduction to the concept, and permits Rebol to show off nicely. I can think of a number of cases where I would use a PRINT/ONLY. Functionally it is more useful than PRIN. And the "joke" of removing the last letter of a word is not repeated later in Rebol techniques, e.g. it is APPEND/ONLY and not a separate operation called APPEN.

Additionally, the existence of a PRINT/ONLY would allow people to achieve many of the goals they would have in using successive PRIN statements by passing in a block of the components, which could be trusted to not insert spaces or newlines. Teaching people to pass blocks to PRINT is a better long-term expressive strategy than the not-a-word PRIN represents.
Example code
>> print [{Hello} {World}]
Hello World
;-- with newline, spaces inserted between components

>> print/only [{Hello} {World}]
HelloWorld ;-- no newline, no spaces between components

>> print/only [{Hello} space {World}]
Hello World ;-- no newline, space is explicit

>> print/only [{Hello} {World} newline]
HelloWorld
;-- no spaces, newline is explicit

Assigned ton/a Fixed in- Last Update26-Feb-2014 16:20


Comments
(0004047)
endo
7-Oct-2013 13:12

Sounds good.
(0004103)
fork
17-Oct-2013 16:06

Without a larger mission to clear this kind of thing up, cherry-picking such cosmetic changes serves no purpose.

Dismissed.

Date User Field Action Change
26-Feb-2014 16:20 Ladislav Severity Modified minor => major
18-Oct-2013 00:15 Ladislav Category Modified Unspecified => Native
17-Oct-2013 16:06 fork Status Modified submitted => dismissed
17-Oct-2013 16:06 fork Comment : 0004103 Added -
7-Oct-2013 13:12 endo Comment : 0004047 Added -
29-Sep-2013 19:59 fork Code Modified -
29-Sep-2013 17:05 fork Description Modified -
29-Sep-2013 17:04 fork Type Modified Bug => Wish
29-Sep-2013 17:03 fork Code Modified -
29-Sep-2013 17:03 fork Description Modified -
29-Sep-2013 17:03 fork Code Modified -
29-Sep-2013 17:03 fork Ticket Added -