From owner-freebsd-current Mon Dec 21 02:32:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA05015 for freebsd-current-outgoing; Mon, 21 Dec 1998 02:32:41 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from newsguy.com (smtp.newsguy.com [207.211.168.71]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA05009 for ; Mon, 21 Dec 1998 02:32:40 -0800 (PST) (envelope-from dcsobral@newsguy.com) Received: (from dcsobral@localhost) by newsguy.com (8.9.1a/8.9.1) id CAA11540; Mon, 21 Dec 1998 02:32:03 -0800 (PST) Date: Mon, 21 Dec 1998 02:32:03 -0800 (PST) Message-Id: <199812211032.CAA11540@newsguy.com> X-Mailer: Direct Read Email by Newsguy News Service To: mike@smith.net.au From: "Daniel C. Sobral" Subject: Re: BootFORTH - demo floppy Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At Mon, 21 Dec 1998 01:08:54 -0800, you wrote >Commonsense suggests the two major problems: [This is really irrelevant; in particular, my "experience" disagree with the "common sense" of the second statement; but the first statement must be correct for the sake of correct use of FICL. IMHO, anyway] > - the count is usually too small (in the ANS Forth case, it's one byte) Most string words in Forth take their count from the stack, so it's one cell, not byte. I suppose FICL uses 32 bits integers as cells, right? There is *one* word in ANS Forth that takes the count from the memory, as far as I can remember: count. This word is there for backward compatibility purposes. Even then, "it's one byte" it's rather incorrect. Let's see: "Return the character string specification for the counted string stored at c-addr1. c-addr2 is the address of the first character after c-addr1. u is the contents of the character at c-addr1, which is the length in characters of the string at c-addr2." Mind you, "character" is not "byte": "Characters shall be at least one address unit wide, contain at least eight bits, and have a size less than or equal to cell size. " Also, "counted string: A data structure consisting of one character containing a length followed by zero or more contiguous data characters. Normally, counted strings contain text. " "character: Depending on context, either 1) a storage unit capable of holding a character; or 2) a member of a character set. " "Table 3.5 - Environmental Query Strings String Value Constant? Meaning data type /COUNTED-STRING n yes maximum size of a counted string, in characters ... MAX-CHAR u yes maximum value of any character in the implementation-defined character set" So, Unicode Forths would have 65535-sized counted strings. Indeed, some Forths use 32 bits characters. Ok, ok, a brief search shows me a little bit incorrect. WORD and C" return memory-counted strings. C" is core ext and was replaced by S". Though WORD is core and PARSE is core ext, the same applies here (WORD is for compatibility, PARSE has been introduced to eliminate the need for count in memory). -- Daniel C. Sobral dcs@newsguy.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message