Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: ignore

From: jelinem1:nationwide at: 26-Jun-2001 17:34

This is trivial by definition. Then again, so is the number zero. Actually comments would be more descriptive in the case you described. If you're worried about line wrap (under those esoteric conditions?) then you don't even have to use real comments. REBOL lets you state a bare string with no operations and won't complain, so you can use the multi-line string syntax for these comments. Of course this will give your block a return value; after your "comment string" just place the word 'none. Now that I think about it, 'none can probably be used to just as great an effect as your idea for 'ignore. I do see what you're getting at and I agree with your thinking (making code more readable and explicit), I just don't think we need another "trivial" native for this.
>> ignore: none
however, interestingly enough (in /Core 2.5):
>> alias 'none "ignore"
** Script Error: Alias word is already in use: ignore ** Near: alias 'none "ignore"
>> help ignore
No information on ignore (word has no value) Have you stumbled onto something here? What's the deal? - Michael Jelinek From: [ryan--christiansen--intellisol--com]@rebol.com on 06/26/2001 03:16 PM Please respond to [rebol-list--rebol--com] Sent by: [rebol-bounce--rebol--com] To: [rebol-list--rebol--com] cc: Subject: [REBOL] ignore Would it be useful to have a REBOL native word 'ignore? ignore: func [][] Why? Because it can be used in if error? try statements, like as follows... if error? try [publisher-email-address: get-email-address page][ ignore ] If the 'try block returns an error, I place 'ignore in the return block. Sure, you could use comments. if error? try [publisher-email-address: get-email-address page][ ; ignore ] But if for some reason you copy-and-past some code and the words wrap incorrectly, you can inadvertantly comment out code you didn't mean to. You could also simply have nothing at all in the return block. if error? try [publisher-email-address: get-email-address page][] But that doesn't "tell" you anything. Also, the brackets tend to sit rather close in some fonts and can be overlooked. Thoughts? -Ryan