Rebol Talk Forum  |  REBOL Discussions  |  REBOL Chat  |  Topic: suggestion related to "back" and "next"
Pages: [1] Print
Author Topic: suggestion related to "back" and "next"  (Read 203 times)
DrenThales
Newbie
*
Offline Offline

Posts: 6


View Profile
suggestion related to "back" and "next"
« on: April 07, 2008, 08:53:33 AM »

The choice of using the word "back" as the command that returns the series at the current index - 1 seems convoluted to me. The word "back" inheritly implies a doing of something (as in going back). And yet "back" and "next" do not inheritly progress back or to the next index, rather they return the value at such a position; in order to progress "back" or "next", one assigns a word referencing the block to back or next that block. The word "back" has the wrong conoctation and is linguistically inconsistent with the "next" command, it should be changed to "prev" (as in "previous").

Anyway, here's my suggestions for what the series commands in question should be (including some additions):

  prev           return series at index - 1
  next           return series at index + 1

  back           move series index of reference variable back 1 (modify index by - 1)
  forward       move series index of reference variable forward 1 (modify index by + 1)

  begin         move series index of reference variable to head of series
  end           move series index of reference variable to tail of series


It's true that the user can create such commands names themselves, but I think the standard REBOL should have a more clear use of terms than its poorly chosen use of the words "back" and "next".

Oh, and perhaps also consider "jump" vs "skip". The reason being because the phrase "skip 1" actually linguistically implies moving +2 indexes from the current position (because it's "skipping" a certain # of intermediate values); which is not what it does, it moves +1. Whereas, on the other hand, the term "jump" is less ambiguous in meaning (it makes more sense that "jump 1" means index +1, than that "skip 1" means index +1).

Tell me what you think.

« Last Edit: April 07, 2008, 09:12:27 AM by DrenThales » Logged
btiffin
Jr. Member
**
Offline Offline

Posts: 51


View Profile
Re: suggestion related to "back" and "next"
« Reply #1 on: April 07, 2008, 09:14:27 AM »

Tricky business the naming game.

Most of us have gotten so used to the series functions that changing them would probably meet with some resistance.

Brian Hawley ported a new FIRST+ to 2.7.6.  This new function retrieves FIRST and
then advances the series reference.  Handy, and it's SOURCE can be a template for other such words.

Good points though.  Clarity of meaning is something that REBOL terminology hinders rather than helps in some case.

Cheers
Logged
Brian Wisti
Newbie
*
Offline Offline

Posts: 40


View Profile WWW
Re: suggestion related to "back" and "next"
« Reply #2 on: April 07, 2008, 02:32:12 PM »

Tricky business the naming game.

Most of us have gotten so used to the series functions that changing them would probably meet with some resistance.

True, but many of us still haven't gotten used to the series functions despite years of trying to remember the semantics. I really like the proposal, but maybe someday the series stuff as it is will sink in and then I can see suddenly not liking any proposed changes. Still, FIRST+ will be nice.
Logged

Brian Wisti -- My Rebol Notes
DrenThales
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: suggestion related to "back" and "next"
« Reply #3 on: April 09, 2008, 12:16:24 PM »

Backwards support of terminology is all well and good, but consider what has happened in the syntax of C++, for example. C++ is part of a chain of derived languages whose design is highly backwards compatibility oriented; as such, syntax quirks have accumulated in the language over the years. These quirks make it so that those programming in the language must memorize the quirks, which places substantial burden on productivity and slows the rate at which a programmer can develop the source code. Not only that, it also increases the chance of the programmer making errors, and thus also increases the cost of code maintenance.

REBOL is not as old of a language as C++. It would be better to fix it now than to allow the effect of the syntax deficiencies to accumulate. Also, keep in mind that as this is merely a naming change, which changes no underlying behavior whatsoever, it would be easy to simply perform a find and replace all on the document. Not only that, but REBOL technologies could easily include a program in its releases for automatically making the changes to any given document, until such time as no significant amount of source code using the old terminology exists (after all, one of the things REBOL excels at is parsing text).

REBOL has been said of having the purpose of providing uniform communication between computers, among other things. Clear distinction of meaning in words is an asset to language and communication. The more distinct and clear the words, the more powerful a means of expression a language becomes.
« Last Edit: April 10, 2008, 06:33:01 PM by DrenThales » Logged
DrenThales
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: suggestion related to "back" and "next"
« Reply #4 on: April 11, 2008, 04:27:17 PM »


Now that I've thought about it some more, I think defining my suggested (modification oriented) "back", "forward", "begin", and "end" words would likely actually end up being detrimental, because of the clarity decreasing effect that side effect functions (ie 'procedures') tend to have, when one tries to read source code. Better to just literally write the assignment statements.

 Also, now that I think about it, "skip" would be more clear in the context of loop structures and control, so I take back the suggestion of replacing it with "jump".

Also, in suggesting "prev" as a replacement word for "back", I failed to account for the fact that "prev" (ie "previous") has a strong connotation of previous in time, rather than previous in location. To say "prev" might suggest to the reader that the series is being reverted (that it is being moved backwards in time; canceling the current state of the series to set it to the previous state of the series... this would be a bad connotation indeed).

Thus I take back my suggestion, having had time to consider the consequences fully. But it was an entertaining exercise nonetheless.
Logged
DrenThales
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: suggestion related to "back" and "next"
« Reply #5 on: April 12, 2008, 04:29:05 PM »


Well, then again, perhaps "prev" isn't so bad a choice after all. I'll have to think about it some more.
Logged
notchent
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
Re: suggestion related to "back" and "next"
« Reply #6 on: April 13, 2008, 08:21:32 AM »

You can adjust Rebol with your own dialect, as you see fit:

Code:
prev: :back
Logged

DrenThales
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: suggestion related to "back" and "next"
« Reply #7 on: April 13, 2008, 11:22:31 AM »


Yes, I am aware.

The concern was whether or not the standard name is the best name choice.
Logged
fhein
Newbie
*
Offline Offline

Posts: 47


View Profile
Re: suggestion related to "back" and "next"
« Reply #8 on: April 18, 2008, 11:20:52 AM »

I don't think "prev" is a good word since it's an abbreviation of previous, and thus make the code slightly less readable.
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL Chat  |  Topic: suggestion related to "back" and "next"
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 17, 2008, 05:44:16 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2169 Posts in 562 Topics by 1224 Members
Latest Member: thyptoste

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc