programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: class variables not working

From: Mike Ghan <mikeghan_at_logix-controls.com>
Date: Thu, 18 Sep 2003 08:09:08 -0700

Jeff,

Try using BUFFER: instead.

class my-point
   1 cells BUFFER: x
   1 cells BUFFER: y

   : set ( x y -- ) y ! x ! ;
   : show ( -- ) x @ . y @ . cr ;
end-class

Back in Jan-2002, Gene LeFave posted a modified version of SWOOP.F
with many enhancements. At that time, Rick Van Norman and Gene were
hashing out how to incorporate it into SF without breaking existing
code. I did test Gene's revised SWOOP and it seemed stable. I was
hoping for inclusion of Gene's work in the next release of SF.

Mike

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
Behalf
Of Jeff Massung
Sent: Thursday, September 18, 2003 7:15 AM
To: sftalk_at_forth.com
Subject: [sftalk] class variables not working

Attached is a sample source code. Earlier when I posted about
floating-point
members not working in classes, it appears much broader now. Run the
attachment to see what I mean.
If this could be fixed, it would make my life much better, as my
current
project really needs this to work.

Jeff

jma_at_mfire.com
http://www.simforth.com

-- Attached file included as plaintext by Ecartis --
-- File: sample.f

\ sample code that fails

class my-point
        create x 1 cells allot
        create y 1 cells allot

        : set ( x y -- ) y ! x ! ;
        : show ( -- ) x @ . y @ . cr ;
end-class

my-point builds p1
my-point builds p2

1 2 p1 set
3 4 p2 set

p1 show
p2 show

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Thu Sep 18 2003 - 08:11:41 PDT

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:10 PST