Re: pass by reference

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 12 Feb 2002, at 14:10, Irv Mullins wrote:

> 
> On Tuesday 12 February 2002 01:48 pm, Bernie Ryan wrote:
> >
> > atom addr_of_x
> > addr_of_x = allocate(4)
> >
> > > foo(var integer x)
> > >  x = 99
> > > end
> >
> > procedure foo(atom addr_of_x)
> >   poke4(addr_of_x,99)
> > end procedure
> >
> > > foo(x)
> > > ? x  => 99
> >
> > foo(addr_of_x)
> > ? peek4u(addr_of_x) => 99
> 
> So now we have Euphoria with pointers.
> The worst of both worlds.

I see your point, maybe. Ideally, the pointer should be available natively, but 
the reading/writing of the variable should go thru the existing checking. I 
wouldn't want to be allowed to crash the puter by assigning a 2gig sequence 
to an integer.
 
> I'm beginning to like C more and more.

ewwwwwwww

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu