I added it.
I renamed it variadic-input
, still not sure if that's right.
I added it.
I renamed it variadic-input
, still not sure if that's right.
Again, the goal is to faithfully reproduce the user's code as an abstract syntax tree. And there are differences about what you can put into each kind of ring iirc.
I had suggested nonterminals variadic-inputs and variadic-input-list.
Where?
Yes, that's what I meant by
BTW only script rings have restrictions on what can be put in them.
I renamed it to that.
Uh oh isn't that what I said before? Well, anyway, I'm suggesting it now!
is the only place I saw it. (Edge thinks that should be a question.) And anyway,
Righto.
Does this look good?
stack := hat? instruction*
hat := a hat block
instruction := command-block input*
command-block := a command block
input := literal | expression | variadic-inputs
literal := a text | a boolean | a number
expression := expression-block input*
expression-block := a reporter block | a predicate block | ring
variadic-inputs := variadic input*
ring := expr-ring | stack-ring
expr-ring := expression formal-params
stack-ring := stack formal-params
formal-params := variadic formal-param*
formal-param := a formal parameter
variadic := marks variadic inputs
No, the command block doesn't have to have variadic inputs. Just inputs.
input ::= single-input | variadic-input | variadic-input-list
variadic-input ::= single-input*
variadic-input-list ::= list
... but I'm worried that we are wrongly conflating formal inputs (the slots in the empty block) with actual inputs (the expressions filling those slots in this instance of using the block). In other words, that there's no way to denote what the block is asking for, as distinct from what it's getting. But maybe that's okay? Maybe for custom blocks the information about what it's asking for comes from its definition, and for primitives it's just listed in the syntax.
this discussion will end up suggesting static types in 3...2...1...
What? Why do you think that? Languages with dynamic typing can still have a formal syntax. Scheme, for example.
Woops! Fixed.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.