|
|
Up |
|
|
  |
Author: Richard OwlettRichard Owlett Date: Apr 30, 2008 14:14
{Grasshopper, capitalization in subject line significant :}
What is so right with Forth that it *OVERRIDES* ALL negative comments?
Obviously the : ; pair.
What other language morphs to match the "real" world so well in a such
well defined manner?
What's wrong with c.l.f. ?
/begin *RANT*
A close relative of N.I.H. Syndrome.
e g
I'm interested in a variety of problems ranging from subsets of speech
recognition to sources of GPS errors and their significance.
What do they have in common?
Someone else has compiled raw data. It's available in ASCII format.
That requires me to parse it.
I doubt anyone would claim string handling as a Forth forte.
I've quit asking questions on c.l.f. as typical answer has been
"DON'T DO THAT"
/end *RANT*
|
| |
|
| | 44 Comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: Apr 30, 2008 15:00
Richard Owlett atlascomm.net> writes Re: What's right with FORTH and wrong with c.l.f.
[..]
> e g
> I'm interested in a variety of problems ranging from subsets of speech
> recognition to sources of GPS errors and their significance.
> What do they have in common?
> Someone else has compiled raw data. It's available in ASCII format.
> That requires me to parse it.
> I doubt anyone would claim string handling as a Forth forte.
> I've quit asking questions on c.l.f. as typical answer has been
> "DON'T DO THAT"
I doubt that anybody has discouraged you to solve the *problem*.
They probably advised you to solve it in a way that does not involve
(a specific way of) string handling. E.g. if the input is
12 apestaart 3456 kippekot 18 hondehok -771
the numbers can be fetched by string parsing and >NUMBER.
But also with
: apestaart ; : kippekot ; : hondehok ; PARSE-NAME EVALUATE
Without specific details it is not easy to give advise.
|
| Show full article (0.98Kb) |
|
| | 3 Comments |
|
  |
Author: brian.foxbrian.fox Date: Apr 30, 2008 18:14
On Apr 30, 5:14 pm, Richard Owlett atlascomm.net> wrote:
> {Grasshopper, capitalization in subject line significant :}
>
> What is so right with Forth that it *OVERRIDES* ALL negative comments?
>
> Obviously the : ; pair.
> What other language morphs to match the "real" world so well in a such
> well defined manner?
>
> What's wrong with c.l.f. ?
>
> /begin *RANT*
> A close relative of N.I.H. Syndrome.
>
> e g
> I'm interested in a variety of problems ranging from subsets of speech
> recognition to sources of GPS errors and their significance.
>
> What do they have in common?
> Someone else has compiled raw data. It's available in ASCII format. ...
|
| Show full article (1.57Kb) |
| no comments |
|
  |
Author: Jonah ThomasJonah Thomas Date: Apr 30, 2008 23:57
Richard Owlett atlascomm.net> wrote:
> I'm interested in a variety of problems ranging from subsets of speech
>
> recognition to sources of GPS errors and their significance.
>
> What do they have in common?
> Someone else has compiled raw data. It's available in ASCII format.
> That requires me to parse it.
> I doubt anyone would claim string handling as a Forth forte.
>
> I've quit asking questions on c.l.f. as typical answer has been
>
> "DON'T DO THAT"
My experience has been somewhat different.
Various people are interested in string hasndling with Forth. In general
each of them prefers his own methods, but I've seen them compare notes
and learn from each other.
|
| Show full article (4.95Kb) |
| no comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: May 1, 2008 01:54
mhx@iae.nl (Marcel Hendrix) wrote Re: What's right with FORTH and wrong with c.l.f.
[..]
> E.g. if the input is
> 12 apestaart 3456 kippekot 18 hondehok -771
> the numbers can be fetched by string parsing and >NUMBER.
> But also with
> : apestaart ; : kippekot ; : hondehok ; PARSE-NAME EVALUATE
Free associations .. Would it be nice to have a special type of VOCABULARY
which does *not* insist on a direct string match, but accepts
patterns (vectored FIND)? We could then define not only
words with names, but also words with names that match a certain
pattern. Let's say we can do that with "::" instead of ":".
VOCABULARY myapp myapp DEFINITIONS
S" [a-zA-Z]+" :: ( noop ) ;
PREVIOUS DEFINITIONS
( you must be careful not to leave myapp in the normal search order :-)
12 apestaart 3456 kippekot 18 hondehok -771
would now be equivalent to
12 3456 18 -771
|
| Show full article (1.37Kb) |
| no comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: May 1, 2008 01:59
It's a free association, but still this
> VOCABULARY myapp myapp DEFINITIONS
> S" ," :: ( noop ) ;
> S~ "[a-zA-Z]+"~ :: last-name 1- 1/STRING 2DUP $CREATE ( magic1 ) , ( magic2 ) , ;
> PREVIOUS DEFINITIONS
should be
VOCABULARY myapp myapp DEFINITIONS
S" ," :: ( noop ) ;
S~ "[a-zA-Z]+"~ :: last-name 1- 1 /STRING 2DUP $CREATE ( magic1 ) , 2DUP ( magic2 ) , ;
PREVIOUS DEFINITIONS
Sorry,
-marcel
|
| |
| no comments |
|
  |
Author: The Beez'The Beez' Date: May 1, 2008 03:51
On Apr 30, 11:14 pm, Richard Owlett atlascomm.net> wrote:
> Someone else has compiled raw data. It's available in ASCII format.
> That requires me to parse it.
> I doubt anyone would claim string handling as a Forth forte.
I do. Sure, you need some extra words, but I do actually think that
string handling is one of the strengths of Forth. Some feats I've done
in 4tH (my Forth):
- Parsing Cisco XML files without any extra (external) libs;
- Patching 4tH source files with extra commands without adding any
special markers;
- Eliza (I've not been the only one), text adventure game.
I've equivalents of Basic string handling (start/count), ZX string
handling (start/end), but I rarely seem to use them. /STRING. 1-, CHOP
and BOUNDS are much handier tools in everyday use. And yes, I got
equivalents for substring replacement and substring deletion as well.
Parsing files is unmatched in Forth/4tH. Much easier and versatile
than e.g. C.
I'd never believe for twenty years I'd say this but I do.
Hans
|
| |
| no comments |
|
  |
Author: Jonah ThomasJonah Thomas Date: May 1, 2008 06:57
"The Beez'" bigfoot.com> wrote:
> I've equivalents of Basic string handling (start/count), ZX string
> handling (start/end), but I rarely seem to use them. /STRING. 1-, CHOP
> and BOUNDS are much handier tools in everyday use. And yes, I got
> equivalents for substring replacement and substring deletion as well.
> Parsing files is unmatched in Forth/4tH. Much easier and versatile
> than e.g. C.
The weakness I see is concatenating strings. You can use ALLOCATE and
depend on the system that provides ALLOCATE to do decent garbage
collection. Or you can copy both strings at HERE and trust you'll be
able to -ALLOT the space at the right time.
If the point is to send the string to a file or a pipe etc, you don't
have to concatenate strings, just send all the parts in the right order.
You can get by sending the first part as soon as you know it, and then
you don't have to keep track of it.
|
| Show full article (2.34Kb) |
| 1 Comment |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: May 1, 2008 07:31
> 12 apestaart 3456 kippekot 18 hondehok -771
Do I see a slight influence of my style of names in examples ?
:-)
>-marcel
Groetjes Albert
|
| |
| no comments |
|
  |
|
|
  |
Author: Albert van der HorstAlbert van der Horst Date: May 1, 2008 07:39
>mhx@iae.nl (Marcel Hendrix) wrote Re: What's right with FORTH and wrong with c.l.f.
>[..]
>> E.g. if the input is
>
>> 12 apestaart 3456 kippekot 18 hondehok -771
>
>> the numbers can be fetched by string parsing and >NUMBER.
>
>> But also with
>
>> : apestaart ; : kippekot ; : hondehok ; PARSE-NAME EVALUATE
>
>Free associations .. Would it be nice to have a special type of VOCABULARY
>which does *not* insist on a direct string match, but accepts
>patterns (vectored FIND)? We could then define not only
>words with names, but also words with names that match a certain
>pattern. Let's say we can do that with "::" instead of ":".
>
>VOCABULARY myapp myapp DEFINITIONS ...
|
| Show full article (2.09Kb) |
| no comments |
|
|
|
|