Menu

#68 ENVIRONMENT? not ANS-compliant

SPF 4.19
closed-fixed
nobody
src (38)
5
2011-05-01
2009-07-01
Anonymous
No

Version 4.19 Build 001 at 30.Aug.2008

The ANS spec (section 3.2.6) says, "The name spaces for ENVIRONMENT? and definitions are disjoint. Names of definitions that are the same as ENVIRONMENT? strings shall not impair the operation of ENVIRONMENT?." But the following definition (which tries to detect whether it is running under gforth) causes an infinite loop in SP-Forth.

gforth ( -- flag ) S" gforth" ENVIRONMENT? DUP IF NIP NIP THEN ;

Discussion

  • Nobody/Anonymous

    This definition causes an infinite loop only in case if there NO "gforth" in the environment strings. So, in this case name of this definition is NOT "the same as ENVIRONMENT? strings" (there no such environment string) and not falls into 3.2.6 section of specs.

     
  • ruvim

    ruvim - 2011-05-01
    • status: open --> closed-fixed
     
MongoDB Logo MongoDB