Skip to content

Can I return a struct from a function? #1668

Discussion options

You must be logged in to vote

Yes to the first two questions. You can return structs, but you cannot place patterns inside a function. Patterns can only be placed in the global scope. Also loop statements are considered as function statements so you can't place patterns inside for loops.Instead what you probably want to do is create an array of patterns that reads the data as it grows.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@valnaumov
Comment options

@paxcut
Comment options

@paxcut
Comment options

Answer selected by valnaumov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants