Provide a shorthand for writing out multiple let statements #318

Open
opened 2025-12-30 01:23:30 +01:00 by adam · 1 comment
Owner

Originally created by @KushalP on GitHub (Jul 8, 2025).

At the moment you can write multiple let statements as follows:

let (foo = 10)
let (bar = 42)
  foo + bar

Provide a shorthand for writing out multiple let statements:

let (foo = 10,
     bar = 42)
  foo + bar

This is a suggestion for notation. The main thing would be to reduce the number of let expressions required to define a bunch of values.

Originally created by @KushalP on GitHub (Jul 8, 2025). At the moment you can write multiple `let` statements as follows: ```pkl let (foo = 10) let (bar = 42) foo + bar ``` Provide a shorthand for writing out multiple `let` statements: ```pkl let (foo = 10, bar = 42) foo + bar ``` This is a suggestion for notation. The main thing would be to reduce the number of `let` expressions required to define a bunch of values.
Author
Owner

@DamianReeves commented on GitHub (Jul 10, 2025):

A common syntax in languages that have a let expression is to have a let .. in ... syntax:

let 
    foo = 10
    bar = 42
in
    foo + bar
@DamianReeves commented on GitHub (Jul 10, 2025): A common syntax in languages that have a let expression is to have a `let .. in ...` syntax: ```pkl let foo = 10 bar = 42 in foo + bar ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#318