Skip to content

Instantly share code, notes, and snippets.

@dogbert17
dogbert17 / gist:65aed1ac79efade5ccb2ba2ea31d9350
Created May 16, 2016 18:15
Tryin to document method in IO::Socket
=head2 method put
method put(IO::Socket:D: Str(Cool) $string)
Writes the supplied string, with a C<\n> appended to it,
to the socket, thus sending it to other end of the connection.
Fails if the socket is not connected.
@dogbert17
dogbert17 / gist:5c943bf4448a2ca8f5182ed48a950ac7
Last active May 18, 2016 19:42
Trying to document IO::Path methods 'parent' and 'child'
=head2 method parent
method parent(IO::Path:D: --> IO::Path)
Removes the last portion of the path, and returns the result as a new C<IO::Path>.
my $io = IO::Path.new( "/etc/passwd" );
say $io.parent; # "/etc".IO
=head2 method child
@dogbert17
dogbert17 / gist:18381bf2024f59e38ed10af8914ee1c3
Created May 19, 2016 16:22
Trying to document methods 'IO' and 'SPEC' in IO::Path
=head2 method IO
method IO(IO::Path:D: --> IO::Path)
Returns the invocant.
=head2 method SPEC
method SPEC(IO::Path:D: --> IO::Spec)
=head2 method resolve
method resolve(IO::Path:D: --> IO::Path)
Returns a new C<IO::Path> object with all symbolic links and references to the
parent directory (C<..>) are physically resolved. This means that the
filesystem is examined for each directory in the path, and any symlinks found
are followed.
# bar is a symlink pointing to "/baz"
@dogbert17
dogbert17 / gist:a4d502c968c7ee91607a66a31298c848
Created May 21, 2016 12:49
Attempt to document X::Temporal::InvalidFormat
=begin pod
=TITLE class X::Temporal::InvalidFormat
=SUBTITLE Error due to using an invalid format when creating a DateTime or Date
class X::Temporal::InvalidFormat does X::Temporal is Exception { }
This exception is thrown when code tries to create a C<DateTime> or C<Date> object
using an invalid format.
@dogbert17
dogbert17 / gist:6a3255180c057f37a824f417a3a0823e
Last active May 23, 2016 20:25
Attempt to document method 'isa' in Mu
=head2 routine isa
multi method isa(Mu $type) returns Bool:D
multi method isa(Str:D $type) returns Bool:D
Returns C<True> if the invocant is an instance of class C<$type>, a subset type or a derived class (through inheritance) of C<$type>.
my $i = 17;
say $i.isa("Int"); # True
say $i.isa(Any); # True
@dogbert17
dogbert17 / gist:50d2cdaf45861a40291b2ec5240f1626
Last active May 25, 2016 16:55
Attempt to document methods floor/ceiling/round and truncate in Complex.pod
=head2 method floor
Defined as:
method floor(Complex:D:) returns Complex:D
Usage:
COMPLEX.floor
@dogbert17
dogbert17 / gist:c8891f3ea49171618e01d27a159152a4
Last active May 25, 2016 18:39
Attempt to document methods abs, conj, gist and perl in class Complex
=head2 method abs
Defined as:
method abs(Complex:D:) returns Num:D
multi sub abs(Complex:D $z) returns Num:D
Usage:
COMPLEX.abs
@dogbert17
dogbert17 / gist:206507725af16451cd100033d5df0f91
Created May 26, 2016 19:31
Feeble attempt to document method 'default' in class Hash
=head2 method default
Defined as:
method default returns ??? # what should be written here
Usage:
Hash.default
@dogbert17
dogbert17 / gist:447575b42b268b3d562a020bb754fadd
Last active May 28, 2016 12:06
Attempt to document method keyof in class Hash
=head2 method keyof
Defined as:
method keyof
Usage:
Hash.keyof