[gforth] / gforth / struct0x.fs  

gforth: gforth/struct0x.fs

Diff for /gforth/struct0x.fs between version 1.3 and 1.4

version 1.3, Mon Jan 2 17:16:52 2012 UTC version 1.4, Thu Jul 19 23:32:25 2012 UTC
Line 17 
Line 17 
 \ You should have received a copy of the GNU General Public License  \ You should have received a copy of the GNU General Public License
 \ along with this program. If not, see http://www.gnu.org/licenses/.  \ along with this program. If not, see http://www.gnu.org/licenses/.
   
 : +field ( n1 n2 "name" -- n3 ) \ X:structures plus-field  : standard+field ( n1 n2 "name" -- n3 ) \ X:structures plus-field
     over if      over if
         (field) over ,          (field) over ,
     else      else
Line 25 
Line 25 
     then      then
     + ;      + ;
   
   Defer +field
   \ A number of things have field-like structure, but not
   \ exactly field-like behavior.  Objects, locals, etc.
   \ Allow them to plug into +field.
   
   : standard:field ( -- )
       \g set +field to standard behavior
       ['] standard+field IS +field ;
   
   standard:field
   
 : extend-structure ( n "name" -- struct-sys n ) \ Gforth  : extend-structure ( n "name" -- struct-sys n ) \ Gforth
     \g extend an existing structure      \g extend an existing structure
     >r 0 value lastxt >body r> ;      standard:field >r 0 value lastxt >body r> ;
   
 : begin-structure ( "name" -- struct-sys 0 ) \ X:structures  : begin-structure ( "name" -- struct-sys 0 ) \ X:structures
     0 extend-structure ;      0 extend-structure ;


Generate output suitable for use with a patch program
Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help