-
Notifications
You must be signed in to change notification settings - Fork 8
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
feature: Name spaces #850
Comments
Many thanks for freeing up the name Instead of I want to ask about the use of file names here. How are filenames considered?
If we don't use a Stef says: When the discussion has settled down, I (or someone else) will summarize this comment to its bare essence needed to document our design decisions. |
As @sjcjoosten points out, a can of worms exists in the edge cases. I prefer to keep things practical. If we borrow the best practices of Haskell, we will end up with a very acceptable solution. This conforms to the above point 4. As a consequence, each file will start with the full namespace. Names will have points for separating folder names, as Haskell modules do. Hence we do not have to deal with OS-dependent conventions other than the local one. Unicode of course should be the rule. |
Here is an attempt to define some operational semantics of namespaces and contexts.
To make |
We need to answer two questions. For named objects defined in a context we need another relation:
First question: do we want
to be satisfied in every interpretable namespace? This would mean that every named object defined in a context is implicitly defined in the namespace in which that context is defined. Here is another question: do we want
to be satisfied in every interpretable namespace? This would mean that named objects defined outside a context are valid in every context of that namespace. |
@stefjoosten said:
Alternatively, you could change the signature of valid, and add a relation
This makes sense if (user-) interfaces are contexts: we might want to say that two different interfaces use the same namespace. |
I agree with @sjcjoosten, an alternative approach is needed. For me it doesn't make sense to put If we change the definition of imports to: `RELATION imports[NameSpace*NameSpace]
|
Oh I would like to suggest to use |
We aren't taking into account that namespaces are imported disjointly. Suppose we have the following script:
Do we want to allow this? (I am assuming we're all in favor, but would gladly make the case if someone is not, so please ask!) If so, what would the population of the relation |
Indeed, last friday we discussed this. I just didn't document it. :-( Importing yields a disjoint union of the namespaces. The imported names are prefixed with the name of the namespace and a dot. (like the qualified import mechanism in Haskell). Syntactical details are yet to be determined. I have added this to the first comment in this issue. In a few days time I will delete this comment and the previous (Bas' question) about the disjoint union. Because we are all in agreement here. |
@sjcjoosten said:
What exactly do you mean by 'context c is using the namespace n'?
|
@sjcjoosten said:
I can see how this helps to say that two different interfaces use the same namespace.
In that case, do we want the following to be satisfied in every interpretable namespace?
So the question is: is every named object defined (i.e.declared) in a context implicitly defined in the namespace in which that context is defined? |
Issue #606 asks for |
@Michiel-s, @stefjoosten , and @hanjoosten have discussed an implementation of the multi-context functionality. We have agreed on the following:
PATTERN
in favor ofNAMESPACE
.INCLUDE
statement becomes obsolete. TheIMPORT
statement enhances the namespace with the disjoint union of both namespaces.EQUALS
statement allows the user to equate named objects.We'll implement this in a feature branch. This will lead to a release that is NOT backwards compatible.
The text was updated successfully, but these errors were encountered: