Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #21357

Re: Anonymous code/data/create-does

From mhx@iae.nl (Marcel Hendrix)
Subject Re: Anonymous code/data/create-does
Newsgroups comp.lang.forth
Message-ID <60650399998434@frunobulax.edu> (permalink)
Date 2013-04-04 00:38 +0200
References <kjguri$6i7$1@dont-email.me>
Organization Wanadoo

Show all headers | View raw


Gerry Jackson <gerry@jackson9000.fsnet.co.uk> writes Re: Anonymous code/data/create-does

> On 02/04/2013 22:46, Marcel Hendrix wrote:
>> Another take on anonymous definitions and anonymous create-does structures.
>> Certainly not portable, but interesting to think about.

> Seeing your post has triggered me into posting an ANS Forth 
> implementation of quotations that I developed a bit ago. See the end of 
> this post for the code and examples of use. It runs on my system, 
> GForth, Win32Forth, VFX Forth, SwiftForth, BigForth but not iForth.

It will run on iForth (at least on my version 4.0.1089 :-), when you add
-opt to the definition of ";]".

get-current quot-wl set-current
: [:  ( n -- n+1 )  1+ [ -opt ] ;   \ Start nested quotation
: ;]  ( n -- n-1 )  1- [ -opt ] ;   \ End of quotation
set-current

This is actually a very nasty bug you have found! The problem is
that iForth's SEARCH-WORDLIST  returns ( c-addr u wl -- xt -1 ) and 
not the ( c-addr u wl -- xt 1 ) that you apparently expect. iForth
has turned ;] into an tokenizing word and (because there are no other
possibilities) reports the xt as immediate. As you then execute
the xt (instead of compiling it) your attempt at decrementing TOS 
fails and eventually iForth reports end-of-file. 

The problem does not happen with FIND . At the moment I don't know if
this is a simple bug in SEARCH-WORDLIST, or something worse. I faintly
remember having looked at it before.

Thanks for reporting it.

-marcel

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-02 23:46 +0200
  Re: Anonymous code/data/create-does "WJ" <w_a_x_man@yahoo.com> - 2013-04-02 22:51 +0000
  Re: Anonymous code/data/create-does "WJ" <w_a_x_man@yahoo.com> - 2013-04-02 23:00 +0000
  Re: Anonymous code/data/create-does Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-04-03 11:07 +0100
    Re: Anonymous code/data/create-does m.a.m.hendrix@tue.nl - 2013-04-03 06:53 -0700
      Re: Anonymous code/data/create-does Alex McDonald <blog@rivadpm.com> - 2013-04-03 13:43 -0700
        Re: Anonymous code/data/create-does Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-04-04 18:07 +0100
    Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-04 00:38 +0200
      Re: Anonymous code/data/create-does Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-04-04 18:18 +0100
        Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-04 20:29 +0200
          Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-06 20:40 +0200
            Re: Anonymous code/data/create-does Alex McDonald <blog@rivadpm.com> - 2013-04-06 14:09 -0700
              Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-07 02:04 +0200
                Re: Anonymous code/data/create-does Alex McDonald <blog@rivadpm.com> - 2013-04-06 20:34 -0700
                Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-07 14:00 +0200
                Re: Anonymous code/data/create-does kenney@cix.compulink.co.uk - 2013-04-08 02:38 -0500
                Re: Anonymous code/data/create-does Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2013-04-08 10:58 +0200
                Re: Anonymous code/data/create-does Alex McDonald <blog@rivadpm.com> - 2013-04-08 14:57 -0700
                Re: Anonymous code/data/create-does Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-08 19:26 +0200
                Re: Anonymous code/data/create-does kenney@cix.compulink.co.uk - 2013-04-09 02:07 -0500
  Re: Anonymous code/data/create-does mhx@iae.nl (Marcel Hendrix) - 2013-04-03 22:44 +0200
    Re: Anonymous code/data/create-does Lars Brinkhoff <lars.spam@nocrew.org> - 2013-04-04 12:42 +0200
      Re: Anonymous code/data/create-does Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-04 07:04 -0500
        Re: Anonymous code/data/create-does Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-04 07:07 -0500

csiph-web