Re: C-programmer needs Forth advice




ANSI Forth an obsolete Forth frowns on everything that is common
sense Forth . They argue til midnite on all the old stuff that is
"original"

C is for paychecks , Forth is for writting code or HLL .

There are 2 answers to your question , one is to help
you write better C to hide what you do and look a Wizard
C programmer ,

The other answer is to help you understand how easily
NewForth handles this problem .

See the paradox ?
Forth puts programers out of work by trivializing programming .

BTW My NewForth pocket PC will not need a LCD display nor QWERTY
keyboard.
It talks menus , you select an item from the menu , it "voice
Recognizes"
it ( big deal/Job ! It compares 4 voice words !! ) .
It uses HDD 20 GB and 128MB SDRAM and can "walk" around town with
you and tell you where you are and scold for missing appoinments ....
It is constantly "challenging" you ( making decisions ) , advising
you for it has in it's
database every street lamp , stop sign , post office , best place to
buy this
or that , .....Its compressed in 10 GB . Only NewForth could do
it .

And all here see it as a loss of their paycheck , thus im public
enemy # 1






Daniel wrote:
> Hi,
>
> I am a C and assembly programmer, so I think in variables and
> registers. I know Forth a bit, but I don't like stack juggling. Local
> variables seem to be frowned upon in Forth, so I wonder if you can
> really live without them. As an example, here's a typical C-function,
> can anybody tell me how can this be done in Forth? The function reads
> characters from a file, stores them in a buffer, zero-terminates the
> buffer, and returns the number of characters read.
>
> int read(char *buf, FILE *file)
> {
> int len = 0;
> int c;
>
> while ((c = fgetc(file)) != EOF)
> {
> *(buf++) = (char) c;
> len++;
> }
> *buf = 0;
> return len;
> }
>
> Thanks for any advice,
> Daniel

.



Relevant Pages

  • RE: Update: Web browsers - a mini-farce (MSIE gives in)
    ... >> You don't have to understand how to exploit a buffer overflow in ... >> attacks to restrict SQL input fields to valid characters. ... the careful programmer will write a validation routine that rejects ...
    (Bugtraq)
  • Re: Testing if a pointer is valid
    ... even though the compiler isn't required to diagnose it. ... Some languages do a better job than others of ... and a programmer only does this if he doesn't know what he is doing. ... int* test ...
    (comp.lang.c)
  • Re: Integer types in embedded systems
    ... First, omitting the "int", even if legal, is sloppy and would not ... I compiler doesn't have to do ... You seem to be a beginning embedded programmer, ... Firstly, yes I'm new to embedded systems, but I consider myself to be ...
    (comp.lang.c)
  • Re: Integer types in embedded systems
    ... Oh, my, I had no idea that you were the ultimate programmer, better ... regardless of options used when invoking the compiler. ... So what size should int be? ... of int instead of char. ...
    (comp.lang.c)
  • Re: In the Matter of Herb Schildt: a Detailed Analysis of "C: The Complete Nonsense"
    ... not an int; it is an unsigned integral type, thus, one of unsigned ... know, as Seebach seems not to, that all ints are floats and all floats ... world of mathematics the integers are a subset of the real numbers. ... not strike me as consistent with being a competent programmer. ...
    (comp.lang.c)