To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 627
626  |  628
Subject: 
Re: Syntax for reserving variables in NQC?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Mon, 29 May 2000 20:55:12 GMT
Viewed: 
5054 times
  
Dave Baum wrote:

> In article <3931A0AA.7AA6DEB1@3dgamers.com>, Jan-Albert van Ree
> <javanree@3dgamers.com> wrote:
> 
> > Dave Baum schreef:
> > 
> > > At present I'm leaning more towards a #pragma rather than introducing
> > > another keyword into the language...
> > > 
> > > // reserve RCX variable location 1
> > > #pragma reserve 1
> > > 
> > > How does this sound?  Would people prefer a language construct for this
> > > (and if so, what should it be)?
> > 
> > It looks perfectly logical to me. Will it be possible to reserve a range
> > or
> > do we need to reserve each location separately?
> 
> Handling a range should't be too tough - perhaps like this
> 
> #pragma  start [count]
> 
> where count is assumed to be 1 if not present
> 
> // reserve location 1
> #pragma 1
> 
> // reserve locations 5,6 and 7
> #pragma 5 3
> 
> ---
> 
> The alternative would be
> 
> #pragma start [end]
> 
> where end is assumed to be equal to start
> 
> #pragma 1
> #pragma 5 7
> 
> ---

I would suggest leaving it simple. For example:

#pragma 1

Would reserve var. one.

#pragma 1 5 9 10 31

Would reserve var.'s 1, 5, 9, 10 & 31

It's the easiest to see at a glance and would be easy to adjust as you changed
your code.

Dean
--
Coin-Op's For Sale!: http://www.akasa.bc.ca/tfm/coin-op.html
Dean's Lego Workshop: http://www.akasa.bc.ca/tfm/lego_wr.html
Vancouver Lego Club: http://www.akasa.bc.ca/vlc



Message has 1 Reply:
  Re: Syntax for reserving variables in NQC?
 
(...) How about: #pragma reserve 1 3 5-8 9 with range explicitly specified by "-". Then those that want to specify a range can do so and those who want to specify a list can do so. Of course this assumes that you don't allow arithmetic in the pragma (...) (26 years ago, 2-Jun-00, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: Syntax for reserving variables in NQC?
 
(...) Handling a range should't be too tough - perhaps like this #pragma start [count] where count is assumed to be 1 if not present // reserve location 1 #pragma 1 // reserve locations 5,6 and 7 #pragma 5 3 --- The alternative would be #pragma (...) (26 years ago, 28-May-00, to lugnet.robotics.rcx.nqc)

8 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR