From owner-freebsd-bugs Sun Jan 24 04:50:06 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA00436 for freebsd-bugs-outgoing; Sun, 24 Jan 1999 04:50:06 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA00360 for ; Sun, 24 Jan 1999 04:50:00 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id EAA17376; Sun, 24 Jan 1999 04:50:01 -0800 (PST) Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA00327 for ; Sun, 24 Jan 1999 04:49:19 -0800 (PST) (envelope-from dcs@newsguy.com) Received: from daniel.sobral by peach.ocn.ne.jp (8.9.1a/OCN) id VAA29174; Sun, 24 Jan 1999 21:48:58 +0900 (JST) Received: (from root@localhost) by daniel.sobral (8.9.1/8.9.2) id VAA00511; Sun, 24 Jan 1999 21:48:30 +0900 (JST) (envelope-from root) Message-Id: <199901241248.VAA00511@daniel.sobral> Date: Sun, 24 Jan 1999 21:48:30 +0900 (JST) From: dcs@newsguy.com Reply-To: dcs@newsguy.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/9662: Conditional compilation for ficl Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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