Skip to content

A trace function #130

Closed
Closed
@copumpkin

Description

@copumpkin

There might well be one already, but I looked under the "Assertions and Debugging" section of the stdlib docs and only saw assertions.

Basically, I want a function that is equivalent to

local const(str, x) = x;

But that prints str to stderr as a side effect when forced. Very handy for debugging odd execution flow and the like.

Both Haskell and Nix call this function trace, but I'm open to other ideas.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions