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 / 242
    NQC wishlist —Vlad Dumitrescu
   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)
   
        Re: NQC wishlist —Dave Baum
   (...) 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, (...) (25 years ago, 23-Nov-99, to lugnet.robotics.rcx.nqc)
   
        Re: NQC wishlist —Nick Taylor
     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 —Vlad Dumitrescu
     (...) 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 —Uwe Denzer
     (...) 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 —Dave Baum
     A switch statment will be added pretty soon. The variable stuff is on hold for the moment. I'm holding off on the booleans until I work out a better strategy for variable allocation and code generation in general. Dave (...) for X-mas), (...) nested (...) (25 years ago, 3-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Vlad Dumitrescu
     (...) I am sure more people than me are looking forward to that! About the "smaller" integer variables, I have put together a couple of macros that simulate an array of packed "small" integers, any bit size works, but power-of-2 sizes do not waste (...) (25 years ago, 4-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Uwe Denzer
      (...) Great! (...) Vlad, that's funny. Immediately after seeing Dave's reply, I decided to make such macros myself. But I got disturbed and couldn't do it today anymore. Since you seem to have done it already, I'll just wait to see yours :-) (...) (...) (25 years ago, 4-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Dave Baum
     (...) Implementation of ## gets pretty nasty - at least within the current pre-processor design. I'll look at the C spec again, but I'm pretty sure ## forces a re-tokenization. In the current design of NQC, tokenization happens before (...) (25 years ago, 4-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Vlad Dumitrescu
     (...) I believe the simplest way to do it would be to have an extra preprocessing pass... it will slow down compilation a little, it's true, but maybe not that much as to matter (compilation is anyway so much faster than the downloading anyway) then (...) (25 years ago, 5-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Dave Baum
     (...) If I were to implement it, I probably wouldn't add a second pass. The real obstacle at present is that the literal text for a token cannot always be recovered after it leaves the lexer. For example, '01' and '1' both leave the lexer as an (...) (25 years ago, 6-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Dave Baum
     (...) 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)
    
         Re: NQC wishlist —David Kadansky
      Dave, So far, I've lived without ##, and I'm quite sure I can live without 4) and 5). And can't 3) be replaced in many cases by arithmetic? In my brief stint programming "lego assembler" for the Scout, (Assembler! I'm embarrassed to admit how far (...) (25 years ago, 6-Jan-00, to lugnet.robotics.rcx.nqc)
    
         Re: NQC wishlist —Ben Jackson
      (...) 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 (...) (25 years ago, 6-Jan-00, to lugnet.robotics.rcx.nqc)
     
          Re: NQC wishlist —Dave Baum
      (...) 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)
    
         Re: NQC wishlist —Vlad Dumitrescu
     (...) I think 1 and 2 are the ones that would be really needed. 2 would be useful in writing macros to emulate arrays or "small" variables. But maybe there will be support for that in the compiler... cheers /Vlad (25 years ago, 6-Jan-00, to lugnet.robotics.rcx.nqc)
   
        Re: NQC wishlist —Mark Rendle
   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)
 

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