Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78684 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31738 invoked from network); 4 Nov 2014 21:18:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 21:18:09 -0000 Authentication-Results: pb1.pair.com header.from=jelle.zijlstra@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jelle.zijlstra@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: jelle.zijlstra@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:39323] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/F4-02095-F8249545 for ; Tue, 04 Nov 2014 16:18:08 -0500 Received: by mail-la0-f44.google.com with SMTP id gf13so1695937lab.3 for ; Tue, 04 Nov 2014 13:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ss4dTVn7Juh1ezmKVWRG0kC2RMARBcgkTF3GVoN48u0=; b=IKqHzornrFhvgxlh3oV0uUCuNUFDX/X+hDLRGAKxxW4CV+kSlwPlCHdo5PrU7t1S9t GNCTax1BW+WT7lTXp0zj0+fhiNbsSH4qPZpf1rInw7szV/YX4sN+dTCWzXxiy5RFlD9m BDV1vCSzKil+AqvUqM4nHKsoUb5cwc0GVwQK3WI8zAxM4QHgZcYOY3LPPkfUIohKU/Q+ GjnPIOL8IWVNrO/rBcdyXnWgyNDc26D3BKc+Y7qVW1c/k1n4G4ztx1JIX5654hJ7RGds Mj053Xq57a5JKGsYDPUtxtOn1dL234Yo8KT+dHss5NgYXKJRBiN8lLEuQpzu8GGmRaA9 04og== MIME-Version: 1.0 X-Received: by 10.112.52.37 with SMTP id q5mr26536635lbo.32.1415135884610; Tue, 04 Nov 2014 13:18:04 -0800 (PST) Received: by 10.112.26.164 with HTTP; Tue, 4 Nov 2014 13:18:04 -0800 (PST) In-Reply-To: <54591231.1030801@sugarcrm.com> References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> <54591231.1030801@sugarcrm.com> Date: Tue, 4 Nov 2014 13:18:04 -0800 Message-ID: To: Stas Malyshev Cc: Andrea Faulds , Robert Stoll , PHP Internals Content-Type: multipart/alternative; boundary=001a11c3f860b60ffc05070eff76 Subject: Re: AW: [PHP-DEV] Types on the right or on the left From: jelle.zijlstra@gmail.com (Jelle Zijlstra) --001a11c3f860b60ffc05070eff76 Content-Type: text/plain; charset=ISO-8859-1 2014-11-04 9:51 GMT-08:00 Stas Malyshev : > Hi! > > > I thought it was inconsistent, but after discussions on > > StackOverflow, I don't think it actually is. > > If you specify the type once as "Foo something" and once as "something: > Foo" then I don't see how there's even a place for discussions that it's > inconsistent. > > > Return types describe the return type of a function, not the type of > > a function. > > Given that in PHP functions do not have types, not being objects of the > language, this seems to be argument invented just to ignore the > inconsistency. > > Moreover, in languages where functions do have types - e.g. ML for > example - the return of the function is specified in exactly the same > manner as parameter type, and type of the function itself is never > specified explicitly, but if needed, it is referred to with different > syntax (->). See: https://en.wikipedia.org/wiki/Standard_ML > > Same situation with ActionScript: > https://en.wikipedia.org/wiki/ActionScript > both parameters and return type use ":" and nobody thinks that specifies > type of the function - as, again, nobody ever specifies type of the > function as such. In fact, I can remember no language that would specify > type of the function (as opposed to parameters + returns) when declaring > a function, even among languages with first class functions. > > Haskell does: length :: [a] -> Int length [] = 0 length (_:xs) = 1 + length xs > > Also, it's worth bearing in mind that `public Foo function` was > > rejected previously. > > Many things were rejected previously, but the RFC does not bring any > argument about it and never even mentions it as far as I can see. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c3f860b60ffc05070eff76--