Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@cgranade
Copy link
Contributor

This PR adds a new EmptyArray function to help deprecate the new keyword, and in keeping with the improvements at microsoft/QuantumLibraries#313.

Copy link
Member

@msoeken msoeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. Thanks!

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
@msoeken
Copy link
Member

msoeken commented Sep 18, 2020

I was wondering what happens if we call Default<'T[]>() for some 'T? Would that also return an empty array?

@cgranade
Copy link
Contributor Author

See microsoft/iqsharp#325 for a discussion of build failures.

@cgranade
Copy link
Contributor Author

I was wondering what happens if we call Default<'T[]>() for some 'T? Would that also return an empty array?

At the moment, there's a bug that causes Default<'T[]>() to return a null array (which isn't even a concept in Q#) when run against the simulation runtime. More generally, though, this new function could allow us to deprecate Default entirely in favor of using array functions like EmptyArray, ConstantArray, and so forth. See further discussion at microsoft/qsharp-compiler#589.

@github-actions github-actions bot merged commit 6cdd16a into feature/arrays Sep 22, 2020
@github-actions github-actions bot deleted the cgranade/empty-array branch September 22, 2020 21:45
github-actions bot pushed a commit that referenced this pull request Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants