[Swift-devel] Problem with @extractint?

Ben Clifford benc at hawaga.org.uk
Tue Oct 9 10:46:16 CDT 2007



On Tue, 9 Oct 2007, Michael Wilde wrote:

> If I understood this case right, the data dependencies were logically correct
> but didnt behave so because @extractint() wasnt treated as a first-class
> value.  (Mihael, can you clarify, if I got this wrong)

It behaves differently because it is used in an assignment statement in 
the broken case and not in an assignment statement in the working case.

Assignments compile to very different looking code than, for example, 
procedure calls (and different kinds of assignments compile to different 
kinds of code, too). There's certainly scope for reworking some of that 
behaviour based on changes that have happened over the past year.

> Until one gets this model, Swift often seems to violate the "principle 
> of least astonishment" ;)

There are also many rough edges in both the model and the implementation 
(such as the behaviour you encountered).

-- 



More information about the Swift-devel mailing list