0

I've started to play with the Tanka and can't find anywhere the answer to the question:

What is difference between

(import "my.jsonnet")

and

import "my.jsonnet"

and why the following construction is valid:

(import "my.jsonnet") + (import "my1.jsonnet")

but this one isn't:

import "my.jsonnet" + import "my1.jsonnet"

What role do the parentheses play here?

1 Answers1

0

It's a syntax matter:

import "my.jsonnet" + import "my1.jsonnet"

gives below error

file.jsonnet:1:8-43 Computed imports are not allowed

because that line is interpreted as if you were trying to overload "my.jsonnet" with the + that follows it, i.e. for the interpreter it'd look similar to:

import "my" + ".jsonnet";

which would (more obviously) trigger above error regarding import filenames requirement to be "static" strings.

jjo
  • 2,595
  • 1
  • 8
  • 16