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


Groups > comp.lang.forth > #10617

Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl?

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl?
Date 2012-03-28 01:26 +0200
Organization 1&1 Internet AG
Message-ID <jktibk$36m$1@online.de> (permalink)
References (2 earlier) <5d48fdde-22c1-4c1f-98e7-d0645923b17f@k14g2000vbe.googlegroups.com> <e7952794-5597-43c9-9c2b-d27febf0c3ff@px4g2000pbc.googlegroups.com> <2012Mar26.114306@mips.complang.tuwien.ac.at> <jkq2ov$uo8$1@online.de> <91bc3a3a-51e9-4761-9cd3-8bfff54f4584@do4g2000vbb.googlegroups.com>

Show all headers | View raw


Alex McDonald wrote:
> It may be a forcing response to the issues that Java programmers face;
> a cascade of ambiguous errors, none of which is compartmentalised or
> handled properly until the final, when a long and largely irrelevant
> list of errors hierarchy is presented to the user.

Yes, probably.  The right answer to the problem is usually not to handle 
the exceptions within the program, but use the exceptions to report 
errors directly to the user - at least most of the time.  I think Java 
programs always run into all kinds of troubles, because they are always 
written with a "generate more complexity than the programmer can handle" 
state of mind.

But what shoud I do with something like smartdots.fs (recently added to 
Gforth)?  It's a .s variant that prints addresses in hex, and printable 
strings as s" text", and it does use exception handling for that.  
Anything where c@ doesn't fail is an address.  The same is done on 
strings: Anything shorter than 80 characters (we don't want to print too 
long strings), with every character fetchable by c@ and printable (>=bl) 
is a string.

smart.s (it really just patches Gforth's .s, so you don't need a new 
name, and it works with ~~, as well) is not supposed to report errors to 
users, it's a mere diagnostic tool - it also should never crash.  On 
Android, it is completely useless, because it can only catch the first 
SIGSEGV.  And it sigsegvs on every single number on the stack that 
actually isn't an address (which most of them are not).

Smart.s is an idea from Gerald Wodny, and it can be helpful.  You can do 
things like this:

variable foo  ok
s" foo" foo ' foo .s <4> s" foo" foo ' foo  ok

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

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


Thread

is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? quiet_lad <gavcomedy@gmail.com> - 2012-03-22 12:21 -0700
  Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Jason Damisch <jasondamisch@yahoo.com> - 2012-03-22 12:36 -0700
    Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? quiet_lad <gavcomedy@gmail.com> - 2012-03-25 22:44 -0700
      Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? jc <john.comeau@gmail.com> - 2012-03-25 23:06 -0700
        Re: is forth bad for string and file operations? anyone know forth  and use it rather than awk bash tcl? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-26 09:43 +0000
          Re: is forth bad for string and file operations? anyone know forth  and use it rather than awk bash tcl? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-26 17:42 +0200
            Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Alex McDonald <blog@rivadpm.com> - 2012-03-27 07:49 -0700
              Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-28 01:26 +0200
    Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-27 02:46 -0700
      Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? quiet_lad <gavcomedy@gmail.com> - 2012-03-28 22:43 -0700
        Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Jason Damisch <jasondamisch@yahoo.com> - 2012-03-29 10:18 -0700
  Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-26 03:30 -0700
  Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? Helmar Wodtke <helmwo@gmail.com> - 2012-03-26 06:05 -0700
    Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? quiet_lad <gavcomedy@gmail.com> - 2012-03-28 22:39 -0700
  is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? jeffbopp@gmail.com - 2012-03-26 19:48 -0700
    Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? jc <john.comeau@gmail.com> - 2012-03-26 22:50 -0700
    Re: is forth bad for string and file operations? anyone know forth and use it rather than awk bash tcl? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-27 08:27 -1000

csiph-web