Re: [go-nuts] "go test": common prefix for errors
With contextual logging, do we now have a better pattern easily available? Associate with the context a Logger that goes to T.Log? On Monday, March 13, 2023 at 5:00:51 AM UTC-4 Patrick Ohly wrote: > The underlying problem is that a "go test" only has one output stream: the > text written via `T.Log`. Additional output on stdout or stderr isn't > associated with the test that produced it, which is bad when running tests > in parallel or when running without "go test -v". > > Sean Liao schrieb am Freitag, 10. März 2023 um 19:11:02 UTC+1: > >> implementing a helper/wrapper on your side might be easier, I believe >> most helpers take the TB interface rather than the concrete T type. >> also it sounds more like a failure of the application to separate its >> output streams properly. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/4c7b96df-96c2-4662-a61c-6725f0514c68n%40googlegroups.com.
[go-nuts] "yield" is backwards
The go language is getting better and better for functional programming, and I am here for it. I have enjoyed using APL, Scheme, Python. I was excited to see https://go.dev/wiki/RangefuncExperiment . However, I am puzzled by the choice to name the function parameter that _receives_ a Seq's values "yield". That func does the _complement_ to "yield", it _receives_ the value. Compare with Python's "yield" statement, which _provides_ the value. Couldn't we call the func parameter that receives a Seq's values something like "receive" or "consume"? Thanks, Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/40005721-c187-48bf-b5c4-d66de2263185n%40googlegroups.com.
Re: [go-nuts] "yield" is backwards
I see. I was thinking of it from the point of view of the author of this yield/consume function. From that party's perspective, this function expresses the consumption of the value, not its production. But since the new go lang feature will make that not an explicit function, that is not the most germane point of view. (Yes, I know what Marvin mentioned.) Thanks, Mike On Wednesday, February 7, 2024 at 1:18:00 PM UTC-5 Marvin Renich wrote: > * mspre...@gmail.com [240207 10:43]: > > The go language is getting better and better for functional programming, > > and I am here for it. I have enjoyed using APL, Scheme, Python. I was > > excited to see https://go.dev/wiki/RangefuncExperiment . However, I am > > puzzled by the choice to name the function parameter that _receives_ a > > Seq's values "yield". That func does the _complement_ to "yield", it > > _receives_ the value. Compare with Python's "yield" statement, which > > _provides_ the value. Couldn't we call the func parameter that receives > a > > Seq's values something like "receive" or "consume"? > > In addition to what Axel said, note that "yield" is just an arbitrary > function argument name; you may name it anything you choose. Try > changing "yield" to "abc" and it will still work. > > ...Marvin > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/59e03cd0-9562-4359-ae28-d54bda412bbcn%40googlegroups.com.