Follow

Just published a blog post explaining what I like so much about pointfree programming (also called "tacit programming")

What’s the point of pointfree programming? -- raku-advent.blog/2020/12/22/dr

@codesections Interesting; that's the first time I've seen a name for that style. Rust also tends to do that a lot and I'll admit to not having got used to it; In particular it tends to use it with closures with map/and/or/else combiners. In Raku how do you debug a long chain like that - where you could really do with figuring out what the intermediates are?

@penguin42

> In Raku how do you debug a long chain like that - where you could really do with figuring out what the intermediates are?

If you're using a chain with the ==> operator, it's easy (if slightly cryptic) to add a step that prints its current value and passes it on unmodified:

==> { .say; $_ }()

(or `dd $_;` instead of `.say;` if you want the debug represestation of the value instead of the printed/stringified version)

@penguin42

(Rust's solution is the dbg! macro, which I like even better. I mentioned missing it in , which caused someone to add the equivalent as a module: github.com/alabamenhu/DebugTra )

@codesections Nice; my vague memory is dbg! didn't return the original value originally.

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.