Subject:
|
Re: NQC wishlist
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Thu, 6 Jan 2000 10:16:31 GMT
|
Viewed:
|
2089 times
|
| |
| |
In lugnet.robotics.rcx.nqc, Dave Baum writes:
> As a first test, I'd add support for ## with the caveat that it will only
> work reliably on glomming together two identifiers into a new identifier.
That would still be handy. Just the other night I was readying some NQC for
distribution and I had:
#define FOO_SENSOR SENSOR_2
and what I wanted to do was (beyond the user configurable part):
#define DISPLAY_FOO DISPLAY_ ## FOO_SENSOR
so I could:
SetSensor(FOO_SENSOR, SENSOR_LIGHT);
SelectDisplay(DISPLAY_FOO);
BTW, I almost always type SetDisplay() first and usually get as far as
compiling it once before I remember the incongruity...
--Ben
|
|
Message has 1 Reply: | | Re: NQC wishlist
|
| (...) The inconguity was intentional. I was going to call it SetDisplay(), but then it seemed like: SetDisplay(1) should set the display to show the value 1. I felt that "select" did a better job conveying the fact that there are 7 different display (...) (25 years ago, 7-Jan-00, to lugnet.robotics.rcx.nqc)
|
Message is in Reply To:
| | Re: NQC wishlist
|
| (...) I took a good look at the preprocessor code, and it shouldn't be too hard to implement ## aside from the problem of recovering original token text. Adding support for remembering the original token text is easy to do if you're willing to be a (...) (25 years ago, 6-Jan-00, 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
|
|
|
|