-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@chain one-liner nested in an outer @chain may not work? #42
Comments
Tangentially — if there were a way of combining the @chain read(open("Day-8.txt"), String) begin
strip
split("\n")
@. begin
split("|")
@. begin
strip
split
end
end
end
|
The single line nested chain error is a bug, fixed that here #43 The other thing is that you should not really repeat the underscore so often, it can work if the variable inside @chain "a\nb" begin
strip
split("\n")
map(_) do x
map(split(x, "|")) do y
@chain y strip split
end
end
end |
Ah and I guess you don't need the underscore in the nested |
Thanks a lot! I agree re the underscores. That's related to something I liked about the idea of combining the |
Re the narrower issue — confirmed it works — thanks again. I'll close this issue |
This might be "overusing"
@chain
, but I found there was an inconsistency between one-liner and nested blocks with this:This works:
But making the inner
@chain
into a one-line version fails with "Malformed nested @chain macro"FYI I tried using
do x
rather thando _
, but to no avail.I'm not sure the nesting is a good design — I was attempting to parse a heavily nested string, and was using new indentation to signify each level of nesting — so I'm putting this in for info, rather than something that's important per-se.
Thanks for the excellent package, I'm really enjoying using it
The text was updated successfully, but these errors were encountered: