-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in type of member in documentation #1685
Comments
Wasn't that deliberate, though? After all if the types aren't the same, the value can't possibly be in the list. The implementation can't check at runtime that the |
That's fine. I certainly appreciate this type-checking argument. It just isn't consistent with what we can run |
@kfisler are you arguing that the docs should change or the implementation should change? And: how? |
I don't know what the implementation is. All I know is that I can call Personally, the |
But there are always going to be things that a dynamically typed language will permit that a statically typed one wont, simple as |
Ben, might it not be better if the documentation stated the *intended*
behavior?
I am not a fan of `Any` in this setting.
|
I think this falls into the category of “won’t check dynamically, too
expensive, will enforce statically”. It’s a design point we’ve pretty
deliberately ended up at.
I can’t quickly find a good docs link to explain what gets checked and what
doesn’t statically vs dynamically, which is maybe the thing to fix and
reference from parametric List methods
But I don’t think we have any way to sensibly enforce this dynamically in
general.
It is a static error:
On Mon, Feb 20, 2023 at 4:57 PM Ben Lerner ***@***.***> wrote:
But there are always going to be things that a dynamically typed language
will permit that a statically typed one wont, simple as link(1,
link(true, link("hi", empty))). That doesn't mean we're going to change
the type of lists to be heterogeneous!
—
Reply to this email directly, view it on GitHub
<#1685 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA5IUYWVRDM3N5QE5MEERDWYQHIZANCNFSM6AAAAAAVCEQPRM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
This message was sent from my phone.
|
Okay, so maybe we should just edit the reference to Any in DCIC and gloss
over the fact that actually any input argument would work.
…On Mon, Feb 20, 2023, 8:02 PM Joe Politz ***@***.***> wrote:
I think this falls into the category of “won’t check dynamically, too
expensive, will enforce statically”. It’s a design point we’ve pretty
deliberately ended up at.
I can’t quickly find a good docs link to explain what gets checked and what
doesn’t statically vs dynamically, which is maybe the thing to fix and
reference from parametric List methods
But I don’t think we have any way to sensibly enforce this dynamically in
general.
It is a static error:
On Mon, Feb 20, 2023 at 4:57 PM Ben Lerner ***@***.***> wrote:
> But there are always going to be things that a dynamically typed language
> will permit that a statically typed one wont, simple as link(1,
> link(true, link("hi", empty))). That doesn't mean we're going to change
> the type of lists to be heterogeneous!
>
> —
> Reply to this email directly, view it on GitHub
> <
#1685 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAA5IUYWVRDM3N5QE5MEERDWYQHIZANCNFSM6AAAAAAVCEQPRM
>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
--
This message was sent from my phone.
—
Reply to this email directly, view it on GitHub
<#1685 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALO7SKA66DNE3Q3IWCIMIDWYQH33ANCNFSM6AAAAAAVCEQPRM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm not sure whether you [@jpolitz] are disagreeing with me or think I'm disagreeing with you or what. My position:
So my proposal is that the documentation say it's a homogenously-typed list, but leave the enforcement to statics, maybe an expensive dynamic mode (currently non-existent), or vibes (current dynamic mode). DCIC should pretend like this is type-enforced. After all, it is enforced in current Anchor: |
The type given for member in the docs constrains the element to search for to be of the same type that is in the list, rather than Any, which works in practice.
https://www.pyret.org/docs/latest/lists.html#%28part._lists_member%29
The text was updated successfully, but these errors were encountered: