Greetings, On Sat, 1 May 2010 09:06:44 +0200, Joep Suijs wrote > > 2010/5/1 Kyle <[email protected]>: > > Part of this is volatile variables mean two *different* things depending on > > how they're used! > > What are those two things? One = used in a normal variable definition > and Two = used in a procedure parameter definition?
Correct. > > When passed to a procedure, `volatile byte in aa,' passes the > > pseudo-variable > > a'get. If one doesn't exist, one is created for you. > > > > >> aa=aa+1 > > > > This should fail, and does. But not gracefully. If you pass, `in out,' this > > will succeed. > > > > To make things even stranger, if you simply pass `byte in aa',' then aa = > > aa + > > 1 is well defined. > > > Yes, I noticed the difference. So effectivly 'volatile in' makes the > variable read-only, right? Yes, but more importantly it is passed as a function pointer (a'get()) and does not exist as a real variable. > Reading aa when defined 'volatile out aa' fails gracefully. If I > understand correct, 'volatile out' makes the variable write only... > > Maybe add a few words to the manual on the effect of volatile when > used in a parameter definition... Here's how it currently reads in the manual: ``JALv2 is a pass by value language. Conceptually, an IN parameter is read once when the sub-program enters, and an OUT parameter is written once when the sub-program returns. This is not always desired. For example if a sub-program writes a string of characters to the serial port (passed as parameter), only the last character written will be sent. For this case we need VOLATILE parameters. These are either read each time used (IN) or written each time assigned (OUT). This is accomplished using pseudo variables (see below). If the value passed is not a pseudo-variable, a suitable one is created.'' > BTW, did you have a chance to look at my bug reports? Especially > 20100407 puzzles me - it is a pretty straight-forward program of > about 100 lines that combines many common jallib functions and I > have no idea why it fails... Sorry, I've not yet had time to look into these. -- Kyle York Exalted Ruler Santa Cruz Lodge #824 -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
