To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 25288
25287  |  25289
Subject: 
RE: Why Java for Robots (was NXT and bluetooth enabled phones)
Newsgroups: 
lugnet.robotics
Date: 
Tue, 17 Jan 2006 16:06:39 GMT
Original-From: 
Laurent Desnogues <laurent.desnogues@arm./StopSpam/com>
Viewed: 
1391 times
  
PeterBalch wrote:

What is a robot sitting on Mars to do if it gets an "out of memory" or

"illegal pointer value" or "array bounds exceeded"
error? The first two should never ever happen in a robot. The last
should have been caught by the compiler.

   Well what about an indexation based on a sensor value?
How could your compiler know the range the sensor has?

Sample:

int volatile *color_sensor = (int *) 0x4000;

int getColor(void)
{
    static int color[4] = { 123, 456, 789, 111 };
    return color[*color_sensor];
}

How would you tell your C compiler that the real range of the color
sensor is 0..4 and not 0..3?  No static analysis will get that!

   I guess that puts C in your "shoot the language-designer"
category :)


Laurent

-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium.  Thank you.



Message has 1 Reply:
  Re: Why Java for Robots (was NXT and bluetooth enabled phones)
 
(...) The point about C++ is that you can overload the array indexing mechanism and build a 'class' to implement arrays that does array bounds checking (or implements the "array" as a linked list or stores it on disk or whatever else you can (...) (18 years ago, 17-Jan-06, to lugnet.robotics)

4 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