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

Add maps/objects to VeLa #363

Open
dbenn opened this issue Jul 13, 2023 · 1 comment
Open

Add maps/objects to VeLa #363

dbenn opened this issue Jul 13, 2023 · 1 comment
Assignees
Labels
VeLa VStar expression Language

Comments

@dbenn
Copy link
Collaborator

dbenn commented Jul 13, 2023

Maps (dictionaries) are useful for all kinds of reasons.

Objects would be useful for encapsulating all the features of a ValidObservation, e.g. when used in a filter as well as in general coding. Nothing fancy. Just objects, potentially aggregating other objects vs inheritance or interfaces, although I wouldn't rule out interfaces, i.e. ADTs. So, more object-based than OO.

Ability to access member via m.[str] or m.ident.

Add an object construct, starting with maps. Keys in maps can have any value at all, including functions. Some syntactic sugar may help to objectify, e.g.

m <- map { x: 2  f: function(n:int):int ... }
a <- m["x"]
a <- m.x  -- same as above
b <- m.f(42)

Implicit or explicit reference to map/object available to map/object function calls (this, self, me, my)?

m <- map { x: 2  f: function(n:int):int { this.x*n } )  -- implicit
b <- m.f(42)  -- 84

To achieve this, a function in an object could have a this variable -- m in this case -- added to the current scope.

Could use struct instead of map but latter is more general and powerful and we want to avoid a proliferation of data structures.

Release with a motivating example eg via filters, TG (e.g. maintain heading state).

@dbenn dbenn added the VeLa VStar expression Language label Jul 13, 2023
@dbenn dbenn self-assigned this Jul 13, 2023
@dbenn
Copy link
Collaborator Author

dbenn commented Aug 4, 2023

See also #201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VeLa VStar expression Language
Projects
Development

No branches or pull requests

1 participant