To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 701
700  |  702
Subject: 
Re: NBC/NXC beta news
Newsgroups: 
lugnet.robotics.nxt
Date: 
Sun, 29 Apr 2007 01:01:42 GMT
Viewed: 
18906 times
  
In lugnet.robotics.nxt, John Hansen wrote:
In lugnet.robotics.nxt, Doug Eaton wrote:
Is an array of struct expected to work?  When I try to access a field within an
element I get an error:
The problem with code of this sort is that the opcodes for manipulating values
do not readily allow for this type of operation.
...
I would need to generate code which copies out
cell[index] into a temporary variable of the correct structure type and then I
would need to generate the mov opcode using the temporary variable.  I'd need at
least one unique temporary for each thread and each structure type.

I keep forgetting the not-quite part of your language is an attempt to map
operations directly onto the underlying VM.  I was hoping to avoid rewriting
code but now realize that making all elements of this structure top-level
elements will definitely lead to more efficient execution.  Thanks for the
detailed response.

Doug



Message is in Reply To:
  Re: NBC/NXC beta news
 
(...) The problem with code of this sort is that the opcodes for manipulating values do not readily allow for this type of operation. To set the variable val to the value of the bxxx field of the structure type stored in your array of structs I (...) (17 years ago, 25-Apr-07, to lugnet.robotics.nxt)

7 Messages in This Thread:



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

Custom Search

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