Re: pbr vs multiple returns
- Posted by Jason Gade <jaygade at yahoo.com> Jan 11, 2007
- 538 views
Matt Lewis wrote: > > Jason Gade wrote: > > > > > > I'm not too sure about the challenges in making the caller specify pbr but > > could > > it just be a mechanism like typechecking? Unless typechecking is turned off > > then when the function is called the interpreter makes sure both the > > definition > > and the call itself has the 'ref' keyword. > > The challenge is that I have to rework the parser to be aware of when it's > parsing arguments for a routine call, so that if it finds the PBR token, > it can remember that. Also, if it finds that token anywhere else, it > should cause an error. Sorry, I didn't mean that to imply that there were no challenges but rather that I myself am not familiar with all of the specifics that have to be changed. I had the general idea though... I'm reworking the Shootout program "reverse-complement" and I kind of wish that I had pass-by-reference. However not having it is making me think a little harder about how to write the program in a Euphoria way instead of just copying the C straight over (as well as the other couple of languages that I'm looking at...) -- "Any programming problem can be solved by adding a level of indirection." --anonymous "Any performance problem can be solved by removing a level of indirection." --M. Haertel "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.