Shop OBEX P1 Docs P2 Docs Learn Events
Spin language improvement — Parallax Forums

Spin language improvement

FredBlaisFredBlais Posts: 379
edited 2009-08-14 16:31 in Propeller 1
Do you think that parallax will improve their spin language in the future (maybe with the release of prop2)·with data structure and/or multi-dimensional array? And maybe with some more advanced·OOP capabilities?

Comments

  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-07-30 17:15
    Fred,

    I have no idea - but Parallax does pay attention to what we ask for here.

    - H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • ericballericball Posts: 774
    edited 2009-07-30 17:23
    What I would like to see is the ability to pass an object reference. So if foo.spin uses bar.spin and baz.spin and bar.spin also uses baz.spin, then foo.spin could pass it's instance of baz.spin to bar.spin so there would only be a single instance rather than two.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-30 17:25
    Do keep in mind that Parallax has very limited resources for software development and they have a lot of work to do. There are several free Spin compilers other than the Propeller Tool and these have some additional features. One of them does have support for multidimensional arrays and both have some provisions for conditional compilation. There will need to be a major revision of the Propeller Tool to support the Prop II when that's finally available and that would be the time to introduce new features. The Prop II will have much more memory than the current Propeller and multidimensional arrays and structures will make much more sense with 256K of shared RAM vs. 32K.
  • mparkmpark Posts: 1,305
    edited 2009-07-30 18:04
    Homespun supports multidimensional arrays. It also allows you to pass object pointers·(sort of; see http://forums.parallax.com/showthread.php?p=777920).

    Sphinx is an open source Spin compiler. If you're really ambitious, you could·add your own extensions.
  • agodwinagodwin Posts: 72
    edited 2009-08-13 11:59
    How about using the range notation (n..m) to define the array bounds of variables and objects ?

    So (skipping all usual CON, VAR, OBJ etc) instead of

    
    first = 6
    last = 12
    
      long array[noparse][[/noparse]last-first+1]
    
      repeat ix from first to last
        array[noparse][[/noparse]ix-first] := something
    
        
    
    



    you could have

    
    first = 6
    last = 12
    
      long array[noparse][[/noparse]first..last]
    
      repeat ix from first to last
        array[noparse][[/noparse]ix] := something
    
    
    



    It allows for tidier code with less chance of off-by-one errors, has the potential to be more efficient and fits well with the syntax used elsewhere.

    Post Edited (agodwin) : 8/13/2009 12:06:28 PM GMT
  • tronsnavytronsnavy Posts: 70
    edited 2009-08-14 16:31
    agodwin,

    Can something like your example code be generated in spin (using DAT or VAR)? If so, how? Want to generate an array that will include binary numbers from 000000 (00) to 111111 (3F). Then send specific elements to i/o pins ( outa something[noparse][[/noparse]25] )? Thanks and have a great weekend.

    Bob
Sign In or Register to comment.