data-centric-computing / dcic-public

Repository for (for now) filing bug reports about DCIC.
19 stars 2 forks source link

[DCIC Book]: sets not included #19

Closed shriram closed 2 years ago

shriram commented 2 years ago

Contact Details

shriram@gmail.com

Which Web page has the problem?

https://dcic-world.org/2021-08-21/Collections_of_Structured_Data.html

What's the problem?

This chapter depends on built-in sets, but doesn't say to include sets.

What browser are you seeing the problem on?

No response

sorawee commented 2 years ago

FWIW, with essentials2021, include sets will fail with:

The declaration of fold shadows a built-in declaration of the same name.

The declaration of all shadows a built-in declaration of the same name.

The declaration of set shadows a built-in declaration of the same name.

The declaration of any shadows a built-in declaration of the same name.
kfisler commented 2 years ago

@shriram What do you want me to do about the conflict here? include sets as something and update all the code?

shriram commented 2 years ago

@Joe Gibbs Politz @.***> Thoughts on this? I think that's wisest thing to do. We need sets in only one place…

jpolitz commented 2 years ago

For this iteration, yes, kind of has to be import sets as S or a different context. The set constructor is the painful thing here; lists.set (which does functional replace by index, but no curriculum that I know of uses) is included in essentials2021.

For essentials2022, I think we should hide the list set function, and then probably provide from sets: * hiding (fold, all, any) end as part of essentials2022.

Since we have the essentials mechanism (and have other threads where we're considering dcic as a context), we won't break existing code, and can clean this up. Without writing a custom context, would be hard to do right now for this bug.

kfisler commented 2 years ago

fixed with import sets as S.