Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #41900

Re: `don't` instead of `?do`

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: `don't` instead of `?do`
Date 2015-09-09 20:59 +0200
Organization A noiseless patient Spider
Message-ID <mspvea$7ia$1@dont-email.me> (permalink)
References <mskrip$5ff$1@speranza.aioe.org> <af592592-cf97-453d-bf3b-52f10586f629@googlegroups.com> <msp6iu$fcs$1@speranza.aioe.org> <8e5de78d-d150-48d1-9d4a-fc1f679b0987@googlegroups.com>

Show all headers | View raw


Mark Wills wrote:
> Just my two cents: with factoring you don't need don't. Put your loop in
> its own word and in the calling word use if...then

Well, you can use IF THEN around the DO, too, ?DO just combines both.

When you do such factoring, you leave a word which reacts wrong on e.g. the 
empty string.  That's bad.  All words e.g. dealing with strings should be 
fine with the empty string.  If these words process the string char-by-char, 
they usually do

bounds ?do  ..  loop

and thus work perfectly with the empty string.  Factoring out this check and 
leaving it to the caller simply is wrong.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

`don't` instead of `?do` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-07 20:20 +0000
  Re: `don't` instead of `?do` Julian Fondren <julian.fondren@gmail.com> - 2015-09-08 11:32 -0700
    Re: `don't` instead of `?do` Coos Haak <chforth@hccnet.nl> - 2015-09-09 00:38 +0200
      Re: `don't` instead of `?do` Julian Fondren <julian.fondren@gmail.com> - 2015-09-08 15:52 -0700
        Re: `don't` instead of `?do` Coos Haak <chforth@hccnet.nl> - 2015-09-09 00:58 +0200
    Re: `don't` instead of `?do` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-09 11:53 +0000
      Re: `don't` instead of `?do` Mark Wills <markwills1970@gmail.com> - 2015-09-09 08:48 -0700
        Re: `don't` instead of `?do` Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-09 20:59 +0200
          Re: `don't` instead of `?do` hughaguilar96@gmail.com - 2015-09-10 21:26 -0700

csiph-web