mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-07 07:16:42 +02:00
[nix/en] Add @
syntax to set pattern matching section (#4170)
This commit is contained in:
committed by
GitHub
parent
ad6b3df619
commit
c2ba7b321f
@@ -305,6 +305,9 @@ with builtins; [
|
|||||||
({x, y, ...}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
|
({x, y, ...}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
|
||||||
#=> "a-b"
|
#=> "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
|
# Errors
|
||||||
#=========================================
|
#=========================================
|
||||||
|
Reference in New Issue
Block a user