Subject:
|
Re: NQC wishlist
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Tue, 23 Nov 1999 00:53:33 GMT
|
Viewed:
|
2119 times
|
| |
| |
In article <FLLC2F.EtI@lugnet.com>, "Vlad Dumitrescu"
<vladdu@nospam.hotmail.com> wrote:
> I am not sure if there is such a wishlist... I remember there was a "call for
> wishes" for RxCC...
>
> The biggest problem with the standard firmware is the small amount of
> variables. Since not every use of a variable will use all 16 bits, I think it
> would be neat to include in the language a way to specify how many bits to be
> used for a variable, and automatically handle all bit allocations and
> operations. Right now it is rather tedious to use lots of macros and keep track
> of which bit means what... I think many people will appreciate this.
I'm not really comfortable with variable-length bit allocations since this
isn't something that happens in C outside of structs.
But there could still be a couple "smaller" types. Right now an int is 16
bits. Perhaps a char could be 8 bits, and a bool (borrowed from C++) is 1
bit. These would then get packed into as many 16 bit variables as
needed. I like this idea - especially the notion of bool - since there
are many cases where 16 bits is overkill. I tend to have lots of boolean
flags in my code.
> Another thing to do might be introducing arrays - it's a similar handling, only
> in the other direction ;-)
There is no bytecode level support for indirect addressing, therefore I
could support something like this:
int foo[2];
foo[0] = 7;
foo[1] = foo[0] + 3;
But I couldn't support this:
int foo[2];
int x;
foo[x] = 1;
Since the later is really the whole point of arrays, I'm not sure how much
value there would be in simply glomming a lot of ints together and always
needed to access them via a compile-time constant index.
Dave Baum
--
reply to: dbaum at enteract dot com
|
|
Message has 4 Replies: | | Re: NQC wishlist
|
| Dave, All of these additions to NQC sound great ... especially the char and bool data types! There is no way that we (all the NQC users) can adequately express our appreciation for all of your work in developing and freely distributing NQC. I hope (...) (25 years ago, 23-Nov-99, to lugnet.robotics.rcx.nqc)
| | | Re: NQC wishlist
|
| (...) Yes, that seems to be the best way to go about it. (...) Don't we all do? :-) (...) Hmm, yes, thata I did not think about... well, we'll continue using macros! ;-) Thanks for the response. And for NQC. /Vlad (25 years ago, 23-Nov-99, to lugnet.robotics.rcx.nqc)
| | | Re: NQC wishlist
|
| (...) Hi Dave, I'm using your wonderful tool since just a week now (bought my first RIS for X-mas), and I am already seriously running out of variables ... :-) So, I think your idea of variable types of less than 16 bits such as booles and shorts is (...) (25 years ago, 3-Jan-00, to lugnet.robotics.rcx.nqc)
| | | Re: NQC wishlist
|
| This works as a 1-based 16 element array of Boolean variables... // Boolean constants #define TRUE 1 #define FALSE 0 // Boolean storage - bye bye var 0 int bSys = 0; // Boolean array defines #define bool(i) ((bSys & (i^2)/2) == (i^2)/2) #define (...) (25 years ago, 5-Jan-00, to lugnet.robotics.rcx.nqc)
|
Message is in Reply To:
| | NQC wishlist
|
| I am not sure if there is such a wishlist... I remember there was a "call for wishes" for RxCC... The biggest problem with the standard firmware is the small amount of variables. Since not every use of a variable will use all 16 bits, I think it (...) (25 years ago, 22-Nov-99, to lugnet.robotics.rcx.nqc)
|
17 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
|
|
|
|