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 support for collections #11

Closed
mfulton26 opened this issue Feb 10, 2016 · 1 comment
Closed

Add support for collections #11

mfulton26 opened this issue Feb 10, 2016 · 1 comment

Comments

@mfulton26
Copy link

I'd like to be able to use parameters that are lists or sets.

Today I can do something like the following:

PLATFORM:   x86, ia64, amd64
CPUS:       Single, Dual, Quad
RAM:        128MB, 1GB, 4GB, 64GB
HDD:        SCSI, IDE
OS:         NT4, Win2K, WinXP, Win2K3
IE:         4.0, 5.0, 5.5, 6.0
APPS_size:  0, 1, 2
APPS_0:     n/a, SQLServer, Exchange, Office
APPS_1:     n/a, SQLServer, Exchange, Office

IF [APPS_size] = 0 THEN [APPS_0] = "n/a" AND [APPS_1] = "n/a";
IF [APPS_size] = 1 THEN [APPS_0] <> "n/a" AND [APPS_1] = "n/a";
IF [APPS_size] = 2 THEN [APPS_0] <> "n/a" AND [APPS_1] <> "n/a" AND [APPS_0] <> [APPS_1];

I'd like to be able to write something more succinct though. e.g.:

PLATFORM:   x86, ia64, amd64
CPUS:       Single, Dual, Quad
RAM:        128MB, 1GB, 4GB, 64GB
HDD:        SCSI, IDE
OS:         NT4, Win2K, WinXP, Win2K3
IE:         4.0, 5.0, 5.5, 6.0
APPS (Set): 0..2 of { SQLServer, Exchange, Office }

For a list the above example would not have [APPS_0] <> [APPS_1] and would have APPS (List) instead of APPS (Set) (or some similar grammar).

@jaccz
Copy link
Member

jaccz commented Nov 6, 2016

Here's a nuance of the code that doesn't quite have the same meaning but gets you very close:
https://github.com/Microsoft/pict/blob/master/cli/mparser.cpp#L172

What this means is that you can write things like:

APPS_0:     n/a, SQLServer, Exchange, Office
APPS_1:     <APPS_0>

or even

APPS_0:     n/a, SQLServer, Exchange, Office
APPS_1:     <APPS_0>, AnotherValue, OneMoreValue

Adding more complexity on top of this doesn't seem worth it.

@jaccz jaccz closed this as completed Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants