Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Detecting low-level words. Date: Mon, 28 Apr 2014 01:22:25 -0400 Organization: Aioe.org NNTP Server Lines: 35 Message-ID: References: <6da29953-683e-4874-988e-eb208a43796a@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:29926 On Sun, 27 Apr 2014 12:29:02 -0400, Mark Wills wrote: > Assuming a threaded system, tick the word and if it points to DOCOL it's > a high-level word, otherwise it's something else. > > No standard way to determine it, and the address of DOCOL could change > with each release of a particular forth system. > > If your system had a word that returned the address of [DOCOL] it would > be helpful. Say 'DOCOL... > > : 'DOCOL ( -- ADDR ) ... ... ... ; > > Then it would simply be: > > : IsColonDef ( cfa -- flag ) @ 'DOCOL = ; > > Test: > > ' IsColonDef IsColonDef . > It's ENTER instead of DOCOL on my system. It's setup like DOVAR or DODOES which returns the address of those routines so it can be compiled. I may also have DOCON etc internally, unexposed. The idea is some word, like SEE, which emits high-level definitions in terms of the complete sequence of low-level words, not just the uppermost, high-level definition, like TRACE without execution. That can then be analysed for optimization. I would guess that this idea has been around for some time and perhaps even been developed by someone. Rod Pemberton