Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103233 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61016 invoked from network); 23 Sep 2018 10:10:56 -0000 Received: from unknown (HELO mail-pf1-f181.google.com) (209.85.210.181) by pb1.pair.com with SMTP; 23 Sep 2018 10:10:56 -0000 Received: by mail-pf1-f181.google.com with SMTP id k19-v6so7718224pfi.1 for ; Sat, 22 Sep 2018 23:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x7OjX1TSmtXKyJtRmJ/DCfzg+k2hRrkhGhgEsKIt+f8=; b=adhqaOqk3s0yntTLYlUJh5OiN8ZOaa0zzHXESrC32w/tHt5iG/tXg/yw1exJhxbIqM pQBzifgSDuufSPUohI4Zjeaq2eZ8zwqkTdE8mGpikr/MrCnJlI6fec5AbtC9HAUie6bK VZpfYqQ6fD5tNpTuyHy0KcnWdtg5jAUXyPk8+f1OaSAg3i45LnEdL7+AuklbgqnyBwbH uvpJ1LjAE20cnLAC/qAvi4vHlbNa/bOM2k1gUjrvY/X4jUncEt7Rd4aZgeXujzVJxgTq tfpaoDM7Ghj9+Ht5HuOnm7GEO39Rssy5M40+Rndlq4EvVYOlLYVQYW3KOkBUL+p+W99i 5B4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x7OjX1TSmtXKyJtRmJ/DCfzg+k2hRrkhGhgEsKIt+f8=; b=mnptKDzX0goOZlWdA8QEMR5Tm+pT4pd//vQrbvD84qJ8+/T7E7jN5MZO8rsY7Lu87f IAuj9LgWptkI8c9ZXArtEJUWXenrT+as+XD+u5SVGdI+O53NIXACcum7XpHc56DWFGbm zlCmO/ziOrXozQyPG3aPyOQ94j8ohZJonGpLL7yJFXTV11bdCEUjqbpnyFowevZOhp2D a70iEnFv0bdPu/1d/412+nj9uchgxPHA39g4z/6W/uamr7bAGGyJvjWnmHTxkoFZFXMy vuPqE7qnw5E/yi9Bel7/aoPmpnQeXuM+pbCZWQP/2hqjT/HZOk3yURp/qkuqvi4h+ZCO Yedg== X-Gm-Message-State: APzg51C3RnDdHxeO69ctxc/tNwc2k2Xnb2NR7xvsE00BNmIPRpLSx5dx j/yh1xQ8baeJTRDs9uVlf7S0S/VQ1dpykCd3g0c20w== X-Google-Smtp-Source: ANB0VdbZ32HKusv/e9paS7NAY2CPRTpoqIGUw9e8c1H2/K+l1E+bYK7eG4jVr5dbk5MUPW6a75MVuxDZ9z6+ON8Bp0Q= X-Received: by 2002:a62:7616:: with SMTP id r22-v6mr1290675pfc.14.1537683494231; Sat, 22 Sep 2018 23:18:14 -0700 (PDT) MIME-Version: 1.0 References: <5273905.aE8IdBJUB6@vulcan> In-Reply-To: Date: Sun, 23 Sep 2018 08:18:02 +0200 Message-ID: To: Rowan Collins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007376d4057683d6f2" Subject: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 From: rasmus@mindplay.dk (Rasmus Schultz) --0000000000007376d4057683d6f2 Content-Type: text/plain; charset="UTF-8" > That is the entire point of the elephant analogy: that knowing what can get in doesn't necessarily mean knowing what is already inside - BUT, knowing what can get in may still useful in itself. I understood that, and I disagree - just knowing what can get in is not useful or interesting in itself. It's not even a new language feature - you can already achieve the same with a simple setter. It's just new syntax. The only reason it's interesting to control what can get inside with type hints, is to enable the language to do something new - something it couldn't already do, which is to guarantee that the type enforces it's own state specification. I understood the analogy, and I don't agree. On Sun, Sep 23, 2018, 00:42 Rowan Collins wrote: > On 22 September 2018 20:32:04 BST, Rasmus Schultz > wrote: > >if you read my last post (especially the last part) carefully, you'll > >see > >why this elephant analogy is incomplete. > > > >the issue is not whether or not something gets in - it's much more far > >reaching than that. > > > >the issue is, once something gets in, can you even be sure that that > >something is what it claims to be? > > That is the entire point of the elephant analogy: that knowing what can > get in doesn't necessarily mean knowing what is already inside - BUT, > knowing what can get in may still useful in itself. > > The positions being expressed are therefore, roughly: > > a) That it's not the job of this feature to prove what is inside, only to > guard the door. (That is, that the current implementation is sufficient.) > > b) That it is vital to always know what is inside, regardless of how it > got there. (That is, that we must prevent all mechanisms where the value is > uninitialised.) > > c) That there will always be some ways for the wrong thing to end up > inside, but that we can add checks at key moments to see if that's > happened. (That is, that we should detect uninitialised values > automatically at the end of the constructor, and in similar places, but > that there well be other ways that uninitialised values can come about.) > > In your last message, you seemed to be accepting position c - that not all > scenarios could be prevented, but that the common case of the constructor > should be checked. That is the same position Larry is suggesting, so I'm > not sure why you seem keen to disagree with him. > > Regards, > > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0000000000007376d4057683d6f2--