Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #11945
| Newsgroups | comp.lang.forth |
|---|---|
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
| Subject | Re: Distinguishing DOES> |
| Date | 2012-05-06 11:04 +0000 |
| Message-ID | <m3llfk.4jg@spenarnc.xs4all.nl> (permalink) |
| Organization | Dutch Forth Workshop |
| References | <3614770.3.1336060788880.JavaMail.geo-discussion-forums@yngr14> <jo1e2q$gd0$1@dont-email.me> <4fa4fe14$0$294$14726298@news.sunsite.dk> <8512970.374.1336227597535.JavaMail.geo-discussion-forums@vbez20> |
In article <8512970.374.1336227597535.JavaMail.geo-discussion-forums@vbez20>, JennyB <jennybrien@googlemail.com> wrote: >On Saturday, 5 May 2012 11:16:51 UTC+1, Doug Hoffman wrote: > >> Actually, I notice the following when using SEE in Carbon MacForth,=20 >> suggesting that only implementation-specific information is needed and=20 >> that a prototype for comparison is not needed to determine the defining= >=20 >> word. Not sure if all Forths can do this: >>=20 >> : human create does> ; >> human bob >>=20 >> see bob >>=20 >> Name Token Type Flags ^Code Size ^Data >> BOB 9B7FC Does> -N- 4067FC 10 101DC0C >> DOES> word, Created by HUMAN >> vocabulary: FORTH source file: 'untitled' >> 004067FC: 95AEFFFC stwu r13/TOS, $-4(r14/DSP) >> 00406800: 39B3DC0C addi r13/TOS, r19/DBP, -9204 BOB >> 00406804: 3DAD0002 addis r13/TOS, r13/TOS, 2 >> 00406808: 4E800020 blr >>=20 >I suspect that the decompiler simply searches back from the code address re= >ferenced by DOES> to find the closest definition. What does it do with: > > : Foo DOES> ; > : Human CREATE Foo ; > Human Bob > >? > >What started me thinking about this was Gforth's INTERPRET/COMPILE , where = >' POSTPONE and friends are then redefined to return the appropriate behavio= >ur for interpret/compile words. In that case (where any imaginable word may= > be tested) there is no 100% portable solution, because you are limited to = >comparing data space and you can conceivably come across a definition with = >the same data. > >LIKE? seems fairly simple for any particular Forth, but this is the best I = >have managed for CHILD? > >: ACTOR \ 'does ++ > CREATE , DOES> DUP CELL+ SWAP @ EXECUTE ; > >: DEFINER \ 'builds 'does ++ > CREATE 2, DOES> 2@ CHILD EXECUTE ; > >' nop ' nop DEFINER urdefiner >' nop ACTOR uractor > >: CHILD? \ xt1 xt2 -- true if xt1 defined by xt2 > 2DUP ['] urdefiner like?=20 > SWAP ['] uractor like? AND=20 > 0=3D IF FALSE EXIT THEN > > >BODY @ SWAP >BODY @ =3D ; Adding type information to a structure is a trivial exercise. The question raised here is whether we can somehow define a portable way to use the content of the pointer that is filled in by DOES> . After all words that are CREATEd equal have a same pointer. Tucking the same information in the first field is just cumbersome and error prone. Alternatively we can ask whether the information that ANSI demands from a standard system to store, would allow a language extension that finds out similarity based on this already existing information. >=20 >=20 > > > -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Distinguishing DOES> JennyB <jennybrien@googlemail.com> - 2012-05-03 08:59 -0700
Re: Distinguishing DOES> Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-05-03 17:23 -0700
Re: Distinguishing DOES> Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-05-04 10:47 +0100
Re: Distinguishing DOES> Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-05-04 05:12 -0500
Re: Distinguishing DOES> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-05-04 11:33 +0000
Re: Distinguishing DOES> Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-05-04 08:11 -0500
Re: Distinguishing DOES> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-05-04 16:18 +0000
Re: Distinguishing DOES> Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-05-05 02:02 -0500
Re: Distinguishing DOES> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-05-05 14:16 +0000
Re: Distinguishing DOES> Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-05-06 02:53 -0500
Re: Distinguishing DOES> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-05-05 14:25 +0000
Re: Distinguishing DOES> BruceMcF <agila61@netscape.net> - 2012-05-05 08:07 -0700
Re: Distinguishing DOES> Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-05-08 06:23 -0700
Re: Distinguishing DOES> Bernd Paysan <bernd.paysan@gmx.de> - 2012-05-09 00:25 +0200
Re: Distinguishing DOES> Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-05-09 01:26 -0700
Re: Distinguishing DOES> Mark Wills <markrobertwills@yahoo.co.uk> - 2012-05-09 03:18 -0700
Re: Distinguishing DOES> Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-05-09 05:29 -0500
Re: Distinguishing DOES> "Elizabeth D. Rather" <erather@forth.com> - 2012-05-09 07:11 -1000
Re: Distinguishing DOES> Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-05-09 22:48 +0100
Re: Distinguishing DOES> Bernd Paysan <bernd.paysan@gmx.de> - 2012-05-09 23:22 +0200
Re: Distinguishing DOES> Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-05-09 23:43 +0100
Re: Distinguishing DOES> Bernd Paysan <bernd.paysan@gmx.de> - 2012-05-10 00:49 +0200
Re: Distinguishing DOES> Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-05-10 11:33 +0100
Re: Distinguishing DOES> Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-05-10 10:02 +0000
Re: Distinguishing DOES> Bernd Paysan <bernd.paysan@gmx.de> - 2012-05-10 15:13 +0200
Re: Distinguishing DOES> Mark Wills <markrobertwills@yahoo.co.uk> - 2012-05-10 05:07 -0700
Re: Distinguishing DOES> Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-05-10 22:57 -0700
Re: Distinguishing DOES> Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-05-04 12:37 +0000
Re: Distinguishing DOES> Doug Hoffman <glidedog@gmail.com> - 2012-05-04 10:14 -0400
Re: Distinguishing DOES> humptydumpty <ouatubi@gmail.com> - 2012-05-04 20:27 +0000
Re: Distinguishing DOES> Doug Hoffman <glidedog@gmail.com> - 2012-05-05 06:16 -0400
Re: Distinguishing DOES> JennyB <jennybrien@googlemail.com> - 2012-05-05 07:19 -0700
Re: Distinguishing DOES> anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-05-05 14:55 +0000
Re: Distinguishing DOES> JennyB <jennybrien@googlemail.com> - 2012-05-07 07:24 -0700
Re: Distinguishing DOES> Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-05-06 11:04 +0000
Re: Distinguishing DOES> Doug Hoffman <glidedog@gmail.com> - 2012-05-06 07:47 -0400
Re: Distinguishing DOES> ward@megawolf.com - 2012-05-08 04:39 -0700
Re: Distinguishing DOES> Doug Hoffman <glidedog@gmail.com> - 2012-05-08 07:50 -0400
Re: Distinguishing DOES> Hans Bezemer <the.beez.speaks@gmail.com> - 2012-05-05 14:24 +0200
Re: Distinguishing DOES> Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-05-06 11:09 +0000
csiph-web