dollabs / pamela

Probabalistic Advanced Modeling and Execution Learning Architecture
Apache License 2.0
233 stars 13 forks source link

Extend argvals to include vectors and maps #84

Open dcerys opened 7 years ago

dcerys commented 7 years ago

Currently, values of the arguments to plant functions are defined as:

argval   ::= symbol
           | boolean
           | string
           | number
           | safe-keyword

Extend this to also include vectors and maps.

tmarble commented 7 years ago

@dcerys Is your intention that these collections may be recursive? In other words is a vector defined as a vector of argvals? Is a map a set of keyword :: argval mappings (i.e. do we want to restrict the type of keys or not)? Would there be any reason to not have arbitrarily nested collections?

dcerys commented 7 years ago

@tmarble Yes, the ultimate goal is that the values could be collections of arbitrary, heterogeneous values.

tmarble commented 7 years ago

@dcerys I have created a sample file for you to evaluate: https://github.com/tmarble/pamela/blob/issue-84/test/pamela/issue-84.pamela

NOTE: this syntax currently does not build. Please advise if this is what you want.

dcerys commented 7 years ago

Yes, syntax-wise, this sample file shows examples of the use of vectors and maps (including a vector embedded within a map).

As is often the case, this raises another issue. See #89.

dcerys commented 7 years ago

Since this a clean extension, we'll defer this until we have a pressing project that needs this.