1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-06 14:56:54 +02:00

[nix/en] Add @ syntax to set pattern matching section (#4170)

This commit is contained in:
Nathaniel W Griswold
2023-12-14 09:13:20 -06:00
committed by GitHub
parent ad6b3df619
commit c2ba7b321f

View File

@@ -305,6 +305,9 @@ with builtins; [
({x, y, ...}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
#=> "a-b"
# The entire set can be bound to a variable using `@`
(args@{x, y}: args.x + "-" + args.y) { x = "a"; y = "b"; }
#=> "a-b"
# Errors
#=========================================