Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 1999 21:48:30 +0900 (JST)
From:      dcs@newsguy.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/9662: Conditional compilation for ficl
Message-ID:  <199901241248.VAA00511@daniel.sobral>

next in thread | raw e-mail | index | archive | help

>Number:         9662
>Category:       bin
>Synopsis:       FICL has no builtin facility for conditional compilation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 24 04:50:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Daniel C. Sobral
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

	Current as of Jan 23

>Description:

	There is no builtin facility in ficl for conditional compilation.
This is actually just a minor problem, since one can be easily written
by standard programs. Indeed, the one implemented here has come straight
out of ANS Forth draft proposal, plus minor case correction.

>How-To-Repeat:

	UTSL.

>Fix:
	
	Apply the following fix:


--- src/sys/boot/ficl/softwords/softcore.fr	1999/01/09 22:35:43	1.2
+++ src/sys/boot/ficl/softwords/softcore.fr	1999/01/24 12:23:52
@@ -78,6 +78,38 @@
     loop drop
 ;
 
+\ ** Some TOOLS EXT words, straight from the standard
+: [else]  ( -- )
+    1 begin                               \ level
+      begin
+        bl word count  dup  while         \ level adr len
+        2dup  s" [IF]"  compare 0= >r
+	2dup  s" [if]"  compare 0= r> or
+        if                                \ level adr len
+          2drop 1+                        \ level'
+        else                              \ level adr len
+          2dup  s" [ELSE]" compare 0= >r
+	  2dup  s" [else]" compare 0= r> or
+	  if				  \ level adr len
+             2drop 1- dup if 1+ then      \ level'
+          else                            \ level adr len
+	    2dup
+            s" [THEN]"  compare 0= >r	  \ level adr len
+	    s" [then]"  compare 0= r> or
+	    if				  \ level
+              1-                          \ level'
+            then
+          then
+        then ?dup 0=  if exit then        \ level'
+      repeat  2drop                       \ level
+    refill 0= until                       \ level
+    drop
+;  immediate
+
+: [if]  ( flag -- )
+0= if postpone [else] then ;  immediate
+
+: [then]  ( -- )  ;  immediate
 \ ** SEARCH+EXT words and ficl helpers
 \ 
 : wordlist   ( -- )  
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901241248.VAA00511>