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


Groups > comp.lang.forth > #39478

Re: ColorForth - another dead end?

From "Alex McDonald" <blog@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: ColorForth - another dead end?
Date 2015-05-31 09:11 +0100
Organization A noiseless patient Spider
Message-ID <mkefl3$8bb$1@dont-email.me> (permalink)
References (9 earlier) <d6240b02-c36e-408c-98f9-c31543167aa7@googlegroups.com> <mkbs7o$4g9$1@dont-email.me> <7b109f06-c5ad-413c-a9f2-85e7f3b34da4@googlegroups.com> <mkbvcb$en0$1@dont-email.me> <ebfc8bdf-0f90-49b7-8469-b52bcae527e3@googlegroups.com>

Show all headers | View raw


on 30/05/2015 12:08:47, Raimond Dragomir wrote:
> sâmbata, 30 mai 2015, 12:21:24 UTC+3, Alex McDonald a scris:
>> on 30/05/2015 10:05:48, Raimond Dragomir wrote:
>> > sâmbata, 30 mai 2015, 11:27:45 UTC+3, Alex McDonald a scris:
>> >> on 30/05/2015 06:22:27, Raimond Dragomir wrote:
>> >> > Tell me how can you do that in Forth. The big problem is that first
> x
>> >> > has offset 0 and second x has offset of sizeof(int). Still, C has no
>> >> > problem in seeing this.
>> >> >
>> >> > As Hugh says, in Forth it's just impossible.
>> >>
>> >> In Forth it's always possible. Consider using a wordlist as an object
>> >> container; then X in one can be distinct from the X in another. This i
> s
>> >> how the NEON/MOPS object systems, an example of which is in Win32Forth
> ,
>> >> provides scope for its private variables.
>> >
>> > I don't known what NEON/MOPS is. Give me some examples in some
>> > commonly used forths, Win32forth, gforth, VFX. Structures to use by a
>> > forth programm er
>> > in a forth application.
>> > As I said, maybe I'm behind regarding the latest technologies in
>> > forth.
>> >
>> > All I have seen for gforth and win32forth were classical examples with
>> > global field scopes and naming convention by appending the struct name
>> > to the fields. This works fine for me but the whole point was how to
>> > make the fields associated with the object.
>> >
>>
>> http://www.bradrodriguez.com/papers/oofs.htm> http://www.complang.tuwien.ac.at/forth/objects/objects.html> http://bernd-paysan.de/mini-oof.html>
>> and so on.
> 
> You cannot convince me like this.

I can't do your research or thinking for you either.

> Let me give you another example:
> 
> struct mystruct
> field x
> field y
> endstruct
> 
> mystruct obj1
> variable x
> 
>: foo   obj1 x @ x @ + ;
> 
> Do you think the above foo is working?
> Suppose mystruct created an wordlist for the fields, and the fields
> are put in this wordlist.
> obj1 may put the mystruct wordlist on top of the search order.
> Who is taking it back from the search order?
> The second x has this problem. Who is x? the variable or the x field?
> 
> 
> This in C should be something like return obj1.x + x;
> 
> How can you do that in Forth?
> Not to say that if you must pass object pointers on the data stack,
> you loo se
> any type information that a clever implementation may carry.
> 
> I say that in Forth it's impossible because this behaviour is strong
> related to a typing system. And Forth is an untyped language.

The behaviour is related to no more than what structures and objects
derived from them do; either at compile time, run time or both. Typing
has nothing to do with it.

struct point
  field x
  field y
end-struct
point x
x :[ 3 x ! 2 y ! ]:
x :[ x @ y @ ]:
 
X is the structure based on POINT, :[ places POINT's wordlist in the
search order, X and Y do what the field X and field Y for POINT
structures do -- applied to the structure X -- and :] removes POINT's
wordlist from the search order. Yes, it's messy since I have done no more
than illustrate a solution, but you should get the idea.

(An aside. With recognizers we could have for example MYPOINT::X (early
binding) or MYPOINT ::X (late binding) and a much simpler parse.)

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


Thread

ColorForth - another dead end? borota@gmail.com - 2015-05-24 12:22 -0700
  Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 14:00 -0700
    Re: ColorForth - another dead end? borota@gmail.com - 2015-05-24 16:18 -0700
      Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 16:45 -0700
      Re: ColorForth - another dead end? "Elizabeth D. Rather" <erather@forth.com> - 2015-05-24 14:50 -1000
        Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-24 18:12 -0700
          Re: ColorForth - another dead end? onewhohopes@gmail.com - 2015-05-28 13:00 -0700
            Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-28 18:55 -0700
            Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-29 00:49 -0700
              Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 07:56 -0700
                Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-29 15:04 +0000
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 10:03 -0700
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 10:15 -0700
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:28 -0700
                Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-30 12:34 +0000
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:19 -0700
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 22:30 -0700
                Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 00:14 -0400
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-29 22:22 -0700
                Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-30 09:27 +0100
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 02:05 -0700
                Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-30 10:21 +0100
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 04:08 -0700
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-30 07:43 -0700
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 09:42 -0700
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-30 10:25 -0700
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 22:36 -0700
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-31 16:38 -0700
                Re: ColorForth - another dead end? "Alex McDonald" <blog@rivadpm.com> - 2015-05-31 09:11 +0100
                Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-05-31 11:31 -0700
                Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-01 13:21 +0000
                Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 08:18 -0700
                Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 09:07 -0700
                Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 23:31 -0700
                Field name overloading (was: ColorForth - another dead end?) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-02 09:47 +0000
                Re: Field name overloading (was: ColorForth - another dead end?) humptydumpty <ouatubi@gmail.com> - 2015-06-02 13:07 -0700
                Re: ColorForth - another dead end? humptydumpty <ouatubi@gmail.com> - 2015-06-01 08:20 -0700
                Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 15:34 -0400
                Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 22:55 -0700
                Re: ColorForth - another dead end? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-05-30 00:54 -0700
              Re: ColorForth - another dead end? stephen@mpeforth.com (Stephen Pelc) - 2015-05-30 17:20 +0000
                Re: ColorForth - another dead end? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-31 15:17 +0000
        Re: ColorForth - another dead end? Hannu Vuolasaho <vuokkosetae@gmail.com> - 2015-05-25 10:06 +0300
        Re: ColorForth - another dead end? Jason Damisch <jasondamisch@yahoo.com> - 2015-05-25 11:11 -0700
          Re: ColorForth - another dead end? rickman <gnuarm@gmail.com> - 2015-05-25 14:22 -0400
            Re: ColorForth - another dead end? "Elizabeth D. Rather" <erather@forth.com> - 2015-05-25 14:57 -1000
              Re: ColorForth - another dead end? borota@gmail.com - 2015-05-25 20:42 -0700
              Re: ColorForth - another dead end? hughaguilar96@gmail.com - 2015-05-29 19:46 -0700
                Re: ColorForth - another dead end? "Rod Pemberton" <fork@lllljunkqwer.cpm> - 2015-05-30 00:03 -0400
  Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-24 21:51 -0700
    Re: ColorForth - another dead end? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-05-25 11:17 +0000
  Re: ColorForth - another dead end? Mark Wills <markwills1970@gmail.com> - 2015-05-25 01:50 -0700
    Re: ColorForth - another dead end? Howerd <howerdo@yahoo.co.uk> - 2015-05-25 02:11 -0700
  Re: ColorForth - another dead end? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-05-25 14:11 +0000

csiph-web