Re: [Ohrrpgce] BYREF

2010-09-14 Thread Seth Hetu
I'd definitely avoid this situation with gusto. Consider passing '3' (just the number) as by ref into the parameter 'x'  ---what happens if the compiler inlines that variable, copying it to each place the variable is used inside the function? That becomes problematic for, e.g.,:     x = 10

Re: [Ohrrpgce] svn - git bridge, nohrio

2010-09-14 Thread David Gowers
On Sun, Sep 12, 2010 at 9:35 PM, Ralph Versteegen teeem...@gmail.com wrote: On 12 September 2010 19:18, David Gowers 00a...@gmail.com wrote: I always suspected I was exploiting a bug; I guess that it was fixed. It was too good to be be true anyway. c = memmap ('/tmp/kamplita',dtype = 'B',

Re: [Ohrrpgce] BYREF

2010-09-14 Thread Mike Caron
On 9/14/2010 3:56 AM, Seth Hetu wrote: I'd definitely avoid this situation with gusto. Consider passing '3' (just the number) as by ref into the parameter 'x' ---what happens if the compiler inlines that variable, copying it to each place the variable is used inside the function? That becomes

Re: [Ohrrpgce] BYREF

2010-09-14 Thread Seth Hetu
Or, looking at it from a different angle, why are you NOT surprised that you can do this in C? myfunction(Literal string: omg no variable!); Hmm... a good concise example. Thanks, Mike. :) I'm just curious how FB manages this without corrupting memory. It seems like such a weird design

Re: [Ohrrpgce] BYREF

2010-09-14 Thread Mike
? Have you been programming Java recently? Is that what's going on? We've established that passing BYREF is equivalent to passing pointer, and that if there is no variable to point to FB makes one up. Global variables work exactly the same as they always have. BYREF arguments are totally

Re: [Ohrrpgce] BYREF

2010-09-14 Thread Seth Hetu
Nope, just C++. I realize that references just a cleaner way of passing addresses than a pointer. I guess I'm just more comfortable managing the memory myself, and pointers usually force you to explicitly allocate either on the stack (pointer to a locally declared variable, the way most Win32