Hi Jon,

thank you for your mind reading! :::)))

Exactly! 
Now I know, that racket passes references under the hood
and the world is getting a better place again.

Cheers
Meino



Jon Zeppieri <zeppi...@gmail.com> [16-11-01 04:40]:
> On Mon, Oct 31, 2016 at 11:28 PM, <meino.cra...@gmx.de> wrote:
> 
> >
> > Hi Jon,
> >
> > thanks for reply! :)
> >
> > My plan was, to return only one element from that list and
> > possibly some extra informations and pass that to the processing
> > function so it could right jump onto that train...
> >
> > Is that possible?
> >
> >
> I think I understand your concern, and I think it's misplaced. Here's what
> I think you're suggesting: you don't want to return the entire remainder of
> the list, because (as you said) it's a really long list, and you're
> concerned about passing around (and possibly duplicating) a ton of data.
> But that's not the way it works. In terms of in-memory representation, all
> that the `member` functions return is a pointer to a position (a particular
> pair) in the original list.
> 
> You seem to be thinking of something like this: if you were using a vector,
> you could return the element and the index where you found that element.
> Then you could continue on from the next index. And you wouldn't want to do
> this with a list, because if you start at the head of the original list,
> you'd first have to follow it down to the nth element before continuing on,
> and that would be inefficient. But what I'm saying is that if you simply
> return the tail of the list using a `member` function, you don't incur that
> extra iteration cost, and you don't duplicate any of the original list.
> 
> - Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to