README

_::Print::Dbg

Provides the dbg function, an alternative to say .raku or Rakudo's &dd. &dbg accepts one or more Raku expressions and prints the value of those expressions and the line on which it was called:

# In file `example.raku` with this as line 1
dbg(42, 5, 'foo'.uc, 1+1);
# OUTPUT: ยซ[example.raku:2]  (42, 5, "FOO", 2)ยป

When passed variables, &dbg will print information about the variables names:

my $i = 42;
my @a = <a b c>;
dbg($i, @a);
[example.raku:3]  (Int $i=42, Array @a=["a", "b", "c"])

The biggest difference between &dbg and &dd is that &dbg returns the value(s) it was called with, which lets you print an expression without preventing other parts of the code from using that expression. For example, you can use &dbg to see the value of &arg in the expression below without interfering with the call to &some-function

sub some-function($arg1, dbg($arg2), $arg3);

_ v0.0.1

A meta package for zero-dependency micro packages of under 70 lines of code

Authors

  • Daniel Sockwell

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Pattern::Match
  • Print::Dbg
  • Self::Recursion
  • Test::Doctest::Markdown
  • Test::Fluent
  • Text::Paragraphs
  • Text::Wrap
  • _

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.