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


Groups > comp.lang.forth > #13581

Re: ENVIRONMENT?

Newsgroups comp.lang.forth
From Albert van der Horst <albert@spenarnc.xs4all.nl>
Subject Re: ENVIRONMENT?
Date 2012-07-05 02:33 +0000
Message-ID <m6o1r5.ane@spenarnc.xs4all.nl> (permalink)
Organization Dutch Forth Workshop
References <f7528036-6314-419c-9e10-4b095531abff@z19g2000vbe.googlegroups.com> <d87dab3b-efb6-4e35-9d2d-7850f1ff72f6@a16g2000vby.googlegroups.com> <089ec209-fcb3-40aa-8952-0dbe7ba77d94@j25g2000yqn.googlegroups.com> <d4f60fa4-52a2-45ec-a9a4-3e436d8fde67@d6g2000vbe.googlegroups.com>

Show all headers | View raw


In article <d4f60fa4-52a2-45ec-a9a4-3e436d8fde67@d6g2000vbe.googlegroups.com>,
Mark Wills  <markrobertwills@yahoo.co.uk> wrote:
>On Jul 4, 7:57=A0pm, BruceMcF <agil...@netscape.net> wrote:
>> On Jul 4, 4:52=A0am, Mark Wills <markrobertwi...@yahoo.co.uk> wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > On Jul 3, 4:29=A0pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>> > wrote:
>>
>> > > Mark Wills <markrobertwi...@yahoo.co.uk> writes:
>> > > >Why on earth does ENVIRONMENT accept a string? Why couldn't it simpl=
>y
>> > > >be a numeric value?
>>
>> > > >It's annoying that ENVIRONMENT? is part of ANS Core, yet it's a rath=
>er
>> > > >sizeable routine, because of the strings that need to be stored in a
>> > > >lookup table etc. This is a real pain for embedded/memory constraine=
>d
>> > > >systems.
>>
>> > > A very simple implementation of ENVIRONMENT?:
>>
>> > > : environment? ( ( c-addr u -- false | i*x true )
>> > > =A0 2drop false ;
>>
>> > > - anton
>> > > --
>> > > M. Anton Ertl =A0http://www.complang.tuwien.ac.at/anton/home.html
>> > > comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.h=
>tml
>> > > =A0 =A0 =A0New standard:http://www.forth200x.org/forth200x.html
>> > > =A0 =A0EuroForth 2012:http://www.euroforth.org/ef12/
>> > Which makes a mockery of the ENVIRONMENT? word, which
>> > kind of proves my point.
>>
>> How does it "make a mockery" of ENVIRONMENT? ~ if the defaults applied
>> when ENVIRONMENT? does not respond to a particular string are the
>> minimum Forth94 guarantees, then those will often by the exactly right
>> defaults for a minimalist system.
>>
>> And if there are a few values you really do want to return, because
>> you have different models that vary on those points, you can return
>> just those:
>>
>> : ENVIRONMENT? ( ca u -- 0 | i*x TRUE )
>> =A0 =A02DUP S" ADDRESS-UNIT-BITS" COMPARE 0=3D IF
>> =A0 =A0 =A0 2DROP 18 TRUE EXIT THEN
>> =A0 =A02DUP S" CORE" COMPARE 0=3D IF
>> =A0 =A0 =A0 2DROP TRUE TRUE EXIT THEN
>> =A0 =A02DROP FALSE ;
>
>Do I really have to spell it out? Again?
>
>It makes a mockery of the standard because what is the point of
>specifying the behaviour of a word, if the the programmer can simply
>override the bits that are inconvenient to him?
>
>Let me put it another way. Any user of a system should have a
>*reasonable expectation* that if a word is defined in his system he
>can consult the standard in order to learn how to expect it to behave.
>Imagine his surprise/disappointment to learn that for every string he
>passes, valid or not, it simply returns FALSE. What's the point of
>writing it all down in the standard if the implementor can simply say
>"Nah. Don't like it, not doing it."
>
>Then, to add insult to injury, he promotes his system as a standard
>compliant system.
>
>> And if there are a few values you really do want to return, because
>> you have different models that vary on those points, you can return
>> just those:
>
>Please point me to the relevant text, in either the definition of
>ENVIRONMENT? or in the list of strings that says "You can just
>implement the ones you want, and leave out the rest, or implement none
>of them".

I think you're missing an important point about programming
systems. They are by definition resource constrained.
Suppose I have a Pascal program to factorize numbers.
If that is a 80's vintage implementation I will discover
that it complains that 100,000. (>16bits) leads to
overflow, with a decent message (that is why I choose Pascal).

Now Forth.
Likewise if I have a standard program that uses TRUE
and a system that implements TRUE as a loadable extension,
I will discover that loading the standard program leads to
"
    TRUE ? ERROR # 12 NOT RECOGNIZED .
"
That is decent and it is as good as it gets.
Then you have to extend the system with the loadable
extension in a system dependant way.

Of course you can build fat systems that do a good job
in running virtually all standard compliant programs,
such as gforth. That is by definition impossible for
smaller, let alone minimalist/embedded systems.

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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


Thread

ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-03 05:03 -0700
  Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-03 07:45 -0500
  Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-03 15:29 +0000
    Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 01:52 -0700
      Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 04:12 -0500
        Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 02:37 -0700
          Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 05:01 -0500
            Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 03:54 -0700
              Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 06:52 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 05:21 -0700
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 05:19 -0700
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 07:42 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 06:47 -0700
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 09:42 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 08:06 -0700
                Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-04 22:05 +0200
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 08:14 -0700
                Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-05 16:48 +0000
            Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 04:00 -0700
              Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 06:53 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 05:20 -0700
              Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-04 12:31 +0000
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 08:07 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 07:16 -0700
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-04 17:22 +0000
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 07:12 -0700
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 09:47 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 08:14 -0700
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 11:53 -0500
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-04 17:37 +0000
                Re: ENVIRONMENT? Alex McDonald <blog@rivadpm.com> - 2012-07-04 12:46 -0700
                Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-04 21:59 +0200
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-05 02:36 -0500
                Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-04 13:31 -0700
                Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-05 02:06 +0000
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-05 02:33 -0500
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-05 12:12 +0000
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-05 07:50 -0500
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-05 14:15 +0000
                Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-05 15:31 +0200
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-05 14:33 +0000
                Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-06 00:43 +0200
                Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-06 15:37 +0000
                Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-05 09:46 -0500
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 12:44 -0700
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 07:08 -0700
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-04 17:31 +0000
                Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-05 16:44 +0000
                Re: ENVIRONMENT? "Elizabeth D. Rather" <erather@forth.com> - 2012-07-04 08:30 -1000
                Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-05 02:43 +0000
          Re: ENVIRONMENT? "Elizabeth D. Rather" <erather@forth.com> - 2012-07-04 08:16 -1000
      Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-04 11:57 -0700
        Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 12:33 -0700
          Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-04 13:04 -0700
            Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 13:28 -0700
            Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 13:36 -0700
              Re: ENVIRONMENT? "Elizabeth D. Rather" <erather@forth.com> - 2012-07-04 10:49 -1000
                Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 13:58 -0700
                Re: ENVIRONMENT? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-04 22:07 +0000
                Standards Body Attendance (was Re: ENVIRONMENT?) Alex McDonald <blog@rivadpm.com> - 2012-07-05 05:21 -0700
                Re: Standards Body Attendance (was Re: ENVIRONMENT?) stephenXXX@mpeforth.com (Stephen Pelc) - 2012-07-05 15:44 +0000
                Re: Standards Body Attendance (was Re: ENVIRONMENT?) Alex McDonald <blog@rivadpm.com> - 2012-07-06 10:35 -0700
              Re: ENVIRONMENT? Coos Haak <chforth@hccnet.nl> - 2012-07-04 22:50 +0200
              Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-04 16:30 -0700
          Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-05 02:33 +0000
      Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-06 15:48 +0000
        Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-06 11:47 -0700
          Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-06 14:07 -0700
        Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-06 23:55 +0200
  Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-03 18:24 +0000
    Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 01:55 -0700
      Re: ENVIRONMENT? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-07-05 00:19 -0700
    Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 02:29 -0700
      Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-04 15:53 +0000
      Re: ENVIRONMENT? Coos Haak <chforth@hccnet.nl> - 2012-07-04 18:03 +0200
      Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-06 15:42 +0000
        Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-06 11:41 -0700
          Re: ENVIRONMENT? BruceMcF <agila61@netscape.net> - 2012-07-06 14:14 -0700
          Re: ENVIRONMENT? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-06 23:51 +0200
          Re: ENVIRONMENT? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-07 09:24 +0000
  Re: ENVIRONMENT? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-07-03 21:46 -0700
    Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 02:04 -0700
      Re: ENVIRONMENT? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-04 04:30 -0500
      Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 02:32 -0700
      Re: ENVIRONMENT? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-04 16:00 +0000
        Re: ENVIRONMENT? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-07-04 08:37 -0700

csiph-web