Tuesday, July 1, 2014

Dipsy Doodle

This is actually about array using oof ---

or maybe oof arrays --- technically I'm not sure ---

for historical reference, this could be helpful -----

Covering Tommy Dorsey's 1937 hit, Larry Clinton & His Orchestra perform the titular big-band classic in the soundie Dipsy Doodle (1943). This number was often covered, notably by Ella Fitzgerald with Chick Webb's orchestra, & even by Bill Haley & the Comets, besides being goofed up by Homer & Jethro.
from : http://www.weirdwildrealm.com/f-larry-clinton.html



From some where - or maybe here - I acquired on oof array --- what I'm talking about :

https://github.com/BlastarIndia/Blastarix/blob/master/gforth-0.7.2/oofsampl.fs

and I created this " beasty " :

/ oofarray.fs
include oof.fs
: i! postpone ! ; immediate
: i@ postpone @ ; immediate
object class data \ abstract data class
        cell var ref \ reference counter
        method ! method @ method .
        method null method atom? method #
how: : atom? ( -- flag ) true ;
        : # ( -- n ) 0 ;
        : null ( -- addr ) new ;
class;
\ Data structures: int 30apr93py

data class int
        cell var value
how: : ! value i! ;
        : @ value i@ ;
        : . @ 0 .r ;
        : init ( data -- ) ! ;
        : dispose -1 ref +!
          ref i@ 0> 0= IF super dispose THEN ;
        : null 0 new ;
class;

\ Data sturctures: array 30apr93py

data class array
        data [] container
        cell var range
how: : ! container ! ;
        : @ container @ ;
        : . [char] [
                # 0 ?DO emit I container . [char] , LOOP drop ." ]" ;
        : init ( data n -- ) range i! bind container ;
        : dispose -1 ref +! ref i@ 0> 0=
          IF # 0 ?DO I container dispose LOOP
              super dispose THEN ;
        : null nil 0 new ;
        : # range i@ ;
        : atom? false ;
class;
\
\1 3 5 7 9 5 int new[] 5 array : lotus  ok
\lotus . [1,3,5,7,9] ok
\1 lotus @ . 3  ok
\cr 5 1 lotus ! lotus .

more latter - on this --- and where it's going ----

No comments:

Post a Comment