Skip to content
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

Module syntax #605

Closed
stefjoosten opened this issue Dec 28, 2016 · 4 comments
Closed

Module syntax #605

stefjoosten opened this issue Dec 28, 2016 · 4 comments

Comments

@stefjoosten
Copy link
Contributor

stefjoosten commented Dec 28, 2016

Currently, all files specify a context by means of keywords CONTEXT and ENDCONTEXT.

We will introduce a module mechamism, drawn from Haskell's module mechanism. A module corresponds to one file in the file system. Every module is one name space. In a module there can be anything that can be in the current CONTEXT, such as interfaces, views, rules, relations, concepts, populations etc.

PATTERNs remain, but merely for documentation purposes. That goes for MEANING and PURPOSE too.

@RieksJ
Copy link
Contributor

RieksJ commented Dec 29, 2016

I propose to no longer require the CONTEXT-syntax in every file. In a prototype, we need the name of the application (e.g. to generate the database name out of). This could (still) be a CONTEXT name but also the name of the outermost MODULE (without file extension), or something else.

Modules can be IMPORTed, by the syntax

     IMPORT  `filename` AS  `prefix`

where the AS prefix is optional. If present, and if name is the name of relation (or concept? or rule?) that is defined in the module, then prefix.name must be used to refer to that relation (concept, rule). If not present, names can be used as defined in the module.

@stefjoosten
Copy link
Contributor Author

Way of Working

First we will make the concept of Module and express the name-space mechanism in Ampersand itself. This is meant for inclusion in FormalAmpersand. Once that is satisfactory, we can do the same in Haskell in the code of the Ampersand compiler.

@github-actions
Copy link

This issue is stale because it has been open 5 years with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Dec 29, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants