-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Q# Structs: Declaration and Constructor Syntax (#1573)
Declaration and Constructor syntax for Q# structs. Structs can be declared as namespace items with the following syntax: ```qsharp struct Pair { First : Int, Second : Int } ``` Structs types that have been declared can be constructed using the following expression syntax: ```qsharp new Pair { First = 3, Second = 4 } ``` Additionally, structs can be constructed from other structs using the following copy constructor syntax: ```qsharp new Pair { ...existing_pair } ``` and specific fields can be altered while copying: ```qsharp new Pair { ...existing_pair, Second = 7 } ```
- Loading branch information
1 parent
3663b28
commit eaa558a
Showing
39 changed files
with
2,099 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.