[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: List: forEach: arg1;
From: |
Roger M. Burkhart |
Subject: |
Re: List: forEach: arg1; |
Date: |
Wed, 5 Mar 1997 10:38:21 -0600 |
Looks like we had three overlapping responses to the original question and
Kevin Crowston's initial response (further followups by Ken Cline, Glen,
and me). But I agree with Ken:
> Of course you could abandon the "forEach" method:
That's what I meant by coding your own forEach loop.
Glen's suggestion is also workable:
> Couldn't you simply have your method take a pointer
> to a double instead of a double (which is easy enough
> to use in most contexts)?
> There shouldn't be any problems casting a pointer to a double
> to a pointer to an object, should there?
No problem; this is explicitly permitted according to our portability
assumptions. The C standard requires that all data pointers be at least
convertible to or from a void * pointer, and we extend this to all data or
function pointers having the same representation so they can all be passed
in an id slot. There are oddball architectures where even that's not
valid, but I'm not sure if gcc Objective C runs on any of them, and at any
rate Swarm does not.
-Roger