• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Some non-obvious Swift goodies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some non-obvious Swift goodies


  • Subject: Re: Some non-obvious Swift goodies
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 05 Jun 2014 14:00:01 -0700


On Jun 5, 2014, at 1:41 PM, Ron Hunsinger <email@hidden> wrote:

However it's implemented, it turned out to be an extremely powerful tool. I'm delighted to see its re-emergence.

Deferred evaluation does look extremely powerful, but I can imagine it’s also potentially very dangerous if misused, in that it can make the semantics of the calling code very non-obvious. Normally when I look at a function/method call, I know that the parameter expressions get evaluated first, before the function is called. With deferred evaluation that’s not true anymore, and in fact the _expression_ might be evaluated zero times or more than once. That could be really unexpected. People who create APIs (even internal APIs) will need to have the self-discipline to avoid making functions with counter-intuitive behavior. 

(Ruby is a good example of what I’m worried about. It has so many clever syntactic tricks, that it can be nearly impossible to make head or tail of code that uses a Ruby library (like Rails) unless you already know the details of that library’s API.)

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Some non-obvious Swift goodies
      • From: Scott Ribe <email@hidden>
References: 
 >Some non-obvious Swift goodies (From: Jens Alfke <email@hidden>)
 >Re: Some non-obvious Swift goodies (From: Ron Hunsinger <email@hidden>)

  • Prev by Date: Re: Swift JIT
  • Next by Date: Re: Swift JIT
  • Previous by thread: Re: Some non-obvious Swift goodies
  • Next by thread: Re: Some non-obvious Swift goodies
  • Index(es):
    • Date
    • Thread