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


Groups > comp.lang.forth > #9119

Re: existing code to build a 'sed-like'?

From "Rod Pemberton" <do_not_have@noavailemail.cmm>
Newsgroups comp.lang.forth
Subject Re: existing code to build a 'sed-like'?
Date 2012-01-21 15:54 -0500
Organization Aioe.org NNTP Server
Message-ID <jff8pi$kdl$1@speranza.aioe.org> (permalink)
References <jfeido$5uj$1@dont-email.me>

Show all headers | View raw


<no.top.post@gmail.com> wrote in message news:jfeido$5uj$1@dont-email.me...
> When in 2008, I asked about <4thing a kinda sed>, smartass Saushev wrote:
> > Forth is universal programming language (surprise!).
>
> So I'm really going to have to eleborate:--
> The bloke who wrote some of the most used apps of M$,
> and then spent the millions earned to have a space ride,
> appropriately wrote that <choice should be limited in computing>.
> Eg. there should be ONE-only only route to the goal if possible.
>

That's just an expression of the idea that there is one solution which is
most efficient.

What does this have to do with SED or Forth?

> This means minimal syntax.

I don't see how you conclude that.  Minimal syntax doesn't guarantee that
the best solution will be the solution that is coded.  That's up to the
skill, knowledge, and experience of the programmer.  Minimal syntax just
means minimal syntax.  Of course, some believe, like me, that minimal syntax
can lead to more errors than not.  I personally prefer curly-brace and
parenthesis style of C.

> And leads to a strictly-typed Pascal
> approach,

Nor, do I see how you conclude this ...  Are you poking fun at M$ using
Pascal style parameters?

> [...] like a train strictly limited to its track-route,

That is good.

> [...] instead of a C free-chicken type of traveller
> which can hop and fly in any direction.

Is this describing C or Forth?  E.g., is the emphasis or verbal pause as "C"
and "free-chicken type" or as "C free" and "chicken type" ...  I.e., is
there a missing comma between "C" and "free" or between "free" and
"chicken"?  That missing comma is a good lead-in to this:

> Just look at this extract of `man ed` :--
>        An  address range is two addresses separated either
>        by a comma or semicolon. The  value  of  the  first
>        address  in  a range cannot exceed the value of the
>        the second.  If only one  address  is  given  in  a
>        range,  then the second address is set to the given
>        address.  If an n-tuple of addresses is given where
>        n  >  2, then the corresponding range is determined
>        by the last two addresses in the n-tuple.  If  only
>        one  address  is expected, then the last address is
>        used.
> And more and more options are described.
>

What is the point of quoting that?

> Based on how productive ETHOberon *IS* [minimum effort for
> maximum output], I'm looking to find/build a 'sed' like editor, to
> fit with a concatinative, i.e. forth-like programming style system.
>

Ok.

> Since forth's founding philosophy as repeated by C. Moore is "keep it
> simple" I'm hoping that 'the standard forth editor' would be a good
> starting point. Is it; according to what I'm trying to describe?
>

What "standard forth editor"?  Forth itself is the "standard forth editor",
AFAIK.

> A further important factor is that [although I hate stack-shuffling], the
> concatenative style: where you can serially transform your data, and when
> building/testing stage N, you don't need to be concerned about stages
> before N-1.
>

You seem to be rambling ...

> Although the syntax is a mess, conceptually *nix scripts are very
> efficient
> [ito of initial effort and maintainability]; where eg. they can write:-
>  list all the files in directory-tree D |
>  which are less than N days old |
>  and contain string string1 |
> ....
>  and also contain stringN |
>  but take only the 3 smallest of these files|
>  and select the one which has stringS the least times repeated.
>

Look at SNOBOL or Lisp ... (joking).

> Because *nix syntax is so bad, and I don't want to get married/familiar
> with another language, [I can't understand my own code after 6 months]
> can forth help by concatenating [hopefully existing] functions?

If "[you] can't understand [your] own code after 6 months," what makes you
think that some other programming language will help you? ...

> I get the impression that forth programmers don't code at a high level.
> Is that because no libraries of convenient tools/functions exist,
> for such functions to just be concatenated?

I use C mainly.

Forth has colon : and semicolon ; to group operations into units which are
known as "words", i.e., this is Forth's equivalent of a procedure.  The
stack based (0-operand) nature of Forth means there are no parameters
required, but that requires the programmer to keep track of data on the
stack.  Forth HLL functionality is built using a small set of operations.
This is no different than C or Lisp or other programming languages or most
language libraries.


Rod Pemberton


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


Thread

existing code to build a 'sed-like'? no.top.post@gmail.com - 2012-01-21 14:34 +0000
  Re: existing code to build a 'sed-like'? Doug Hoffman <glidedog@gmail.com> - 2012-01-21 10:16 -0500
    Re (2): existing code to build a 'sed-like'? no.top.post@gmail.com - 2012-01-22 06:36 +0000
  Re: existing code to build a 'sed-like'? "Elizabeth D. Rather" <erather@forth.com> - 2012-01-21 08:25 -1000
  Re: existing code to build a 'sed-like'? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-21 15:54 -0500
    Re (2): existing code to build a 'sed-like'? no.top.post@gmail.com - 2012-01-22 10:03 +0000

csiph-web