davidljung / rl-glue

Automatically exported from code.google.com/p/rl-glue
0 stars 1 forks source link

typedef char* Message => typedef const char* Message #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
given the semantics of a message, it would be better to use a
non-modifiable type, both for passing a message and returning a message. 

Original issue reported on code.google.com by Csaba.Szepesvari on 31 Oct 2007 at 6:18

GoogleCodeExporter commented 8 years ago
Apologies that nobody noticed your issues until January.  Sorry.  We have fixed 
the
system so that'll never happen again.

This const stuff caused us a lot of headaches.  The end result was:
typedef char* Message;

Message env_message(const Message message);
Message agent_message(const Message message);

So, the incoming messages are const, the receiving module (agent/env) cannot 
change
them.  So we're half there.  RL-Glue is compatible with C, and apparently 
making a
const (or any other type qualifier) for return types in C is meaningless, and 
on some
platforms with the appropriate warnings on it'll even tell you so.

Thank you for the report though.

Original comment by brian.ta...@gmail.com on 29 Jan 2008 at 6:06