├── .circleci └── config.yml ├── .dockerignore ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── .travis.yml ├── Build.pm6 ├── CONTRIBUTING.md ├── CREDITS ├── Dockerfile ├── LICENSE ├── META6.json ├── Makefile ├── README.md ├── app-start ├── app.pl ├── assets ├── js │ ├── jquery-3.1.1.min.js │ ├── jquery-ui.min.js │ ├── jquery.tablesorter.js │ └── main.js └── sass │ ├── _highlights.scss │ ├── _jquery-ui.scss │ └── style.scss ├── bin └── p6doc ├── cpanfile ├── doc ├── 404.pod6 ├── HomePage.pod6 ├── Language │ ├── 101-basics.pod6 │ ├── 5to6-nutshell.pod6 │ ├── 5to6-overview.pod6 │ ├── 5to6-perlfunc.pod6 │ ├── 5to6-perlop.pod6 │ ├── 5to6-perlsyn.pod6 │ ├── 5to6-perlvar.pod6 │ ├── about.pod6 │ ├── classtut.pod6 │ ├── community.pod6 │ ├── concurrency.pod6 │ ├── containers.pod6 │ ├── contexts.pod6 │ ├── control.pod6 │ ├── create-cli.pod6 │ ├── enumeration.pod6 │ ├── exceptions.pod6 │ ├── experimental.pod6 │ ├── faq.pod6 │ ├── functions.pod6 │ ├── glossary.pod6 │ ├── grammar_tutorial.pod6 │ ├── grammars.pod6 │ ├── hashmap.pod6 │ ├── haskell-to-p6.pod6 │ ├── intro.pod6 │ ├── io-guide.pod6 │ ├── io.pod6 │ ├── ipc.pod6 │ ├── iterating.pod6 │ ├── js-nutshell.pod6 │ ├── list.pod6 │ ├── math.pod6 │ ├── module-packages.pod6 │ ├── modules-core.pod6 │ ├── modules-extra.pod6 │ ├── modules.pod6 │ ├── mop.pod6 │ ├── nativecall.pod6 │ ├── nativetypes.pod6 │ ├── newline.pod6 │ ├── numerics.pod6 │ ├── objects.pod6 │ ├── opener-chars.pod6 │ ├── operators.pod6 │ ├── optut.pod6 │ ├── packages.pod6 │ ├── performance.pod6 │ ├── phasers.pod6 │ ├── pod.pod6 │ ├── pragmas.pod6 │ ├── py-nutshell.pod6 │ ├── quoting.pod6 │ ├── rb-nutshell.pod6 │ ├── regexes-best-practices.pod6 │ ├── regexes.pod6 │ ├── setbagmix.pod6 │ ├── statement-prefixes.pod6 │ ├── structures.pod6 │ ├── subscripts.pod6 │ ├── syntax.pod6 │ ├── system.pod6 │ ├── tables.pod6 │ ├── temporal.pod6 │ ├── terms.pod6 │ ├── testing.pod6 │ ├── traits.pod6 │ ├── traps.pod6 │ ├── typesystem.pod6 │ ├── unicode.pod6 │ ├── unicode_ascii.pod6 │ ├── unicode_entry.pod6 │ └── variables.pod6 ├── Native │ └── int.pod6 ├── Programs │ ├── 01-debugging.pod6 │ ├── 02-reading-docs.pod6 │ ├── 03-environment-variables.pod6 │ └── README.md └── Type │ ├── AST.pod6 │ ├── Any.pod6 │ ├── Array.pod6 │ ├── Associative.pod6 │ ├── Attribute.pod6 │ ├── Backtrace.pod6 │ ├── Backtrace │ └── Frame.pod6 │ ├── Bag.pod6 │ ├── BagHash.pod6 │ ├── Baggy.pod6 │ ├── Blob.pod6 │ ├── Block.pod6 │ ├── Bool.pod6 │ ├── Buf.pod6 │ ├── CX │ ├── Done.pod6 │ ├── Emit.pod6 │ ├── Last.pod6 │ ├── Next.pod6 │ ├── Proceed.pod6 │ ├── Redo.pod6 │ ├── Return.pod6 │ ├── Succeed.pod6 │ ├── Take.pod6 │ └── Warn.pod6 │ ├── CallFrame.pod6 │ ├── Callable.pod6 │ ├── Cancellation.pod6 │ ├── Capture.pod6 │ ├── Channel.pod6 │ ├── Code.pod6 │ ├── Collation.pod6 │ ├── CompUnit.pod6 │ ├── CompUnit │ ├── Repository.pod6 │ └── Repository │ │ ├── FileSystem.pod6 │ │ └── Installation.pod6 │ ├── Compiler.pod6 │ ├── Complex.pod6 │ ├── ComplexStr.pod6 │ ├── Cool.pod6 │ ├── CurrentThreadScheduler.pod6 │ ├── Date.pod6 │ ├── DateTime.pod6 │ ├── Dateish.pod6 │ ├── Distribution.pod6 │ ├── Distribution │ ├── Hash.pod6 │ ├── Locally.pod6 │ └── Path.pod6 │ ├── Distro.pod6 │ ├── Duration.pod6 │ ├── Encoding.pod6 │ ├── Encoding │ └── Registry.pod6 │ ├── Endian.pod6 │ ├── Enumeration.pod6 │ ├── Exception.pod6 │ ├── Failure.pod6 │ ├── FatRat.pod6 │ ├── ForeignCode.pod6 │ ├── Grammar.pod6 │ ├── Hash.pod6 │ ├── HyperSeq.pod6 │ ├── HyperWhatever.pod6 │ ├── IO.pod6 │ ├── IO │ ├── ArgFiles.pod6 │ ├── CatHandle.pod6 │ ├── Handle.pod6 │ ├── Notification.pod6 │ ├── Path.pod6 │ ├── Path │ │ ├── Cygwin.pod6 │ │ ├── QNX.pod6 │ │ ├── Unix.pod6 │ │ └── Win32.pod6 │ ├── Pipe.pod6 │ ├── Socket.pod6 │ ├── Socket │ │ ├── Async.pod6 │ │ └── INET.pod6 │ ├── Spec.pod6 │ ├── Spec │ │ ├── Cygwin.pod6 │ │ ├── QNX.pod6 │ │ ├── Unix.pod6 │ │ └── Win32.pod6 │ └── Special.pod6 │ ├── Instant.pod6 │ ├── Int.pod6 │ ├── IntStr.pod6 │ ├── Iterable.pod6 │ ├── Iterator.pod6 │ ├── Junction.pod6 │ ├── Kernel.pod6 │ ├── Label.pod6 │ ├── List.pod6 │ ├── Lock.pod6 │ ├── Lock │ └── Async.pod6 │ ├── Macro.pod6 │ ├── Map.pod6 │ ├── Match.pod6 │ ├── Metamodel │ ├── AttributeContainer.pod6 │ ├── C3MRO.pod6 │ ├── ClassHOW.pod6 │ ├── ConcreteRoleHOW.pod6 │ ├── CurriedRoleHOW.pod6 │ ├── EnumHOW.pod6 │ ├── Finalization.pod6 │ ├── MROBasedMethodDispatch.pod6 │ ├── MethodContainer.pod6 │ ├── MultipleInheritance.pod6 │ ├── Naming.pod6 │ ├── PackageHOW.pod6 │ ├── ParametricRoleGroupHOW.pod6 │ ├── ParametricRoleHOW.pod6 │ ├── Primitives.pod6 │ ├── PrivateMethodContainer.pod6 │ ├── RoleContainer.pod6 │ ├── RolePunning.pod6 │ ├── Trusting.pod6 │ └── Versioning.pod6 │ ├── Method.pod6 │ ├── Mix.pod6 │ ├── MixHash.pod6 │ ├── Mixy.pod6 │ ├── Mu.pod6 │ ├── NFC.pod6 │ ├── NFD.pod6 │ ├── NFKC.pod6 │ ├── NFKD.pod6 │ ├── Nil.pod6 │ ├── Num.pod6 │ ├── NumStr.pod6 │ ├── Numeric.pod6 │ ├── ObjAt.pod6 │ ├── Order.pod6 │ ├── Pair.pod6 │ ├── Parameter.pod6 │ ├── Perl.pod6 │ ├── Pod │ ├── Block.pod6 │ ├── Block │ │ ├── Code.pod6 │ │ ├── Comment.pod6 │ │ ├── Declarator.pod6 │ │ ├── Named.pod6 │ │ ├── Para.pod6 │ │ └── Table.pod6 │ ├── Defn.pod6 │ ├── FormattingCode.pod6 │ ├── Heading.pod6 │ └── Item.pod6 │ ├── Positional.pod6 │ ├── PositionalBindFailover.pod6 │ ├── PredictiveIterator.pod6 │ ├── Proc.pod6 │ ├── Proc │ └── Async.pod6 │ ├── Promise.pod6 │ ├── Proxy.pod6 │ ├── PseudoStash.pod6 │ ├── QuantHash.pod6 │ ├── RaceSeq.pod6 │ ├── Range.pod6 │ ├── Rat.pod6 │ ├── RatStr.pod6 │ ├── Rational.pod6 │ ├── Real.pod6 │ ├── Regex.pod6 │ ├── Routine.pod6 │ ├── Routine │ └── WrapHandle.pod6 │ ├── Scalar.pod6 │ ├── Scheduler.pod6 │ ├── Semaphore.pod6 │ ├── Seq.pod6 │ ├── Sequence.pod6 │ ├── Set.pod6 │ ├── SetHash.pod6 │ ├── Setty.pod6 │ ├── Signature.pod6 │ ├── Slip.pod6 │ ├── Stash.pod6 │ ├── Str.pod6 │ ├── StrDistance.pod6 │ ├── Stringy.pod6 │ ├── Sub.pod6 │ ├── Submethod.pod6 │ ├── Supplier.pod6 │ ├── Supplier │ └── Preserving.pod6 │ ├── Supply.pod6 │ ├── Systemic.pod6 │ ├── Tap.pod6 │ ├── Telemetry.pod6 │ ├── Telemetry │ ├── Instrument │ │ ├── Thread.pod6 │ │ ├── ThreadPool.pod6 │ │ └── Usage.pod6 │ ├── Period.pod6 │ └── Sampler.pod6 │ ├── Test.pod6 │ ├── Thread.pod6 │ ├── ThreadPoolScheduler.pod6 │ ├── UInt.pod6 │ ├── Uni.pod6 │ ├── VM.pod6 │ ├── ValueObjAt.pod6 │ ├── Variable.pod6 │ ├── Version.pod6 │ ├── Whatever.pod6 │ ├── WhateverCode.pod6 │ ├── X │ ├── AdHoc.pod6 │ ├── Anon │ │ ├── Augment.pod6 │ │ └── Multi.pod6 │ ├── Assignment │ │ └── RO.pod6 │ ├── Attribute │ │ ├── NoPackage.pod6 │ │ ├── Package.pod6 │ │ ├── Required.pod6 │ │ └── Undeclared.pod6 │ ├── Augment │ │ └── NoSuchType.pod6 │ ├── Bind.pod6 │ ├── Bind │ │ ├── NativeType.pod6 │ │ └── Slice.pod6 │ ├── Caller │ │ └── NotDynamic.pod6 │ ├── Channel │ │ ├── ReceiveOnClosed.pod6 │ │ └── SendOnClosed.pod6 │ ├── Comp.pod6 │ ├── Composition │ │ └── NotComposable.pod6 │ ├── Constructor │ │ └── Positional.pod6 │ ├── Control.pod6 │ ├── ControlFlow.pod6 │ ├── ControlFlow │ │ └── Return.pod6 │ ├── DateTime │ │ └── TimezoneClash.pod6 │ ├── Declaration │ │ ├── Scope.pod6 │ │ └── Scope │ │ │ └── Multi.pod6 │ ├── Does │ │ └── TypeObject.pod6 │ ├── Dynamic │ │ └── NotFound.pod6 │ ├── Eval │ │ └── NoSuchLang.pod6 │ ├── Export │ │ └── NameClash.pod6 │ ├── IO.pod6 │ ├── IO │ │ ├── Chdir.pod6 │ │ ├── Chmod.pod6 │ │ ├── Copy.pod6 │ │ ├── Cwd.pod6 │ │ ├── Dir.pod6 │ │ ├── DoesNotExist.pod6 │ │ ├── Link.pod6 │ │ ├── Mkdir.pod6 │ │ ├── Move.pod6 │ │ ├── Rename.pod6 │ │ ├── Rmdir.pod6 │ │ ├── Symlink.pod6 │ │ └── Unlink.pod6 │ ├── Inheritance │ │ ├── NotComposed.pod6 │ │ └── Unsupported.pod6 │ ├── Method │ │ ├── InvalidQualifier.pod6 │ │ ├── NotFound.pod6 │ │ └── Private │ │ │ ├── Permission.pod6 │ │ │ └── Unqualified.pod6 │ ├── Mixin │ │ └── NotComposable.pod6 │ ├── NYI.pod6 │ ├── NoDispatcher.pod6 │ ├── Numeric │ │ └── Real.pod6 │ ├── OS.pod6 │ ├── Obsolete.pod6 │ ├── OutOfRange.pod6 │ ├── Package │ │ └── Stubbed.pod6 │ ├── Parameter │ │ ├── Default.pod6 │ │ ├── MultipleTypeConstraints.pod6 │ │ ├── Placeholder.pod6 │ │ ├── Twigil.pod6 │ │ └── WrongOrder.pod6 │ ├── Phaser │ │ ├── Multiple.pod6 │ │ └── PrePost.pod6 │ ├── Placeholder │ │ ├── Block.pod6 │ │ └── Mainline.pod6 │ ├── Pod.pod6 │ ├── Proc │ │ ├── Async.pod6 │ │ ├── Async │ │ │ ├── AlreadyStarted.pod6 │ │ │ ├── BindOrUse.pod6 │ │ │ ├── CharsOrBytes.pod6 │ │ │ ├── MustBeStarted.pod6 │ │ │ ├── OpenForWriting.pod6 │ │ │ └── TapBeforeSpawn.pod6 │ │ └── Unsuccessful.pod6 │ ├── Promise │ │ ├── CauseOnlyValidOnBroken.pod6 │ │ └── Vowed.pod6 │ ├── Redeclaration.pod6 │ ├── Role │ │ └── Initialization.pod6 │ ├── Scheduler │ │ └── CueInNaNSeconds.pod6 │ ├── Seq │ │ └── Consumed.pod6 │ ├── Sequence │ │ └── Deduction.pod6 │ ├── Signature │ │ ├── NameClash.pod6 │ │ └── Placeholder.pod6 │ ├── Str │ │ └── Numeric.pod6 │ ├── StubCode.pod6 │ ├── Syntax.pod6 │ ├── Syntax │ │ ├── Augment │ │ │ └── WithoutMonkeyTyping.pod6 │ │ ├── Comment │ │ │ └── Embedded.pod6 │ │ ├── Confused.pod6 │ │ ├── InfixInTermPosition.pod6 │ │ ├── Malformed.pod6 │ │ ├── Missing.pod6 │ │ ├── NegatedPair.pod6 │ │ ├── NoSelf.pod6 │ │ ├── Number │ │ │ └── RadixOutOfRange.pod6 │ │ ├── P5.pod6 │ │ ├── Perl5Var.pod6 │ │ ├── Regex │ │ │ ├── Adverb.pod6 │ │ │ └── SolitaryQuantifier.pod6 │ │ ├── Reserved.pod6 │ │ ├── Self │ │ │ └── WithoutObject.pod6 │ │ ├── Signature │ │ │ └── InvocantMarker.pod6 │ │ ├── Term │ │ │ └── MissingInitializer.pod6 │ │ ├── UnlessElse.pod6 │ │ └── Variable │ │ │ ├── Match.pod6 │ │ │ ├── Numeric.pod6 │ │ │ └── Twigil.pod6 │ ├── Temporal.pod6 │ ├── Temporal │ │ └── InvalidFormat.pod6 │ ├── TypeCheck.pod6 │ ├── TypeCheck │ │ ├── Assignment.pod6 │ │ ├── Binding.pod6 │ │ ├── Return.pod6 │ │ └── Splice.pod6 │ └── Undeclared.pod6 │ ├── atomicint.pod6 │ ├── independent-routines.pod6 │ └── utf8.pod6 ├── highlights ├── highlight-file.coffee ├── highlight-filename-from-stdin.coffee ├── highlight-folder.coffee └── package.json ├── html ├── .htaccess ├── css │ └── custom-theme │ │ └── images │ │ ├── ui-bg_glass_45_C0E472_1x400.png │ │ ├── ui-bg_glass_75_c0e472_1x400.png │ │ ├── ui-bg_glass_75_f5e47b_1x400.png │ │ ├── ui-bg_highlight-soft_75_f5e47b_1x100.png │ │ ├── ui-bg_inset-hard_95_e47286_1x100.png │ │ ├── ui-bg_inset-hard_95_f5e47b_1x100.png │ │ ├── ui-icons_000000_256x240.png │ │ ├── ui-icons_63a4ff_256x240.png │ │ └── ui-icons_e13755_256x240.png ├── favicon.ico └── images │ ├── Camelia-faded.svg │ ├── Camelia.svg │ ├── External-link-04-bold-12x12.svg │ ├── camelia-404.png │ ├── camelia-small.png │ └── pencil.svg ├── lib ├── Pod │ ├── Cache.pm6 │ ├── Convenience.pm6 │ └── To │ │ └── SectionFilter.pm6 └── Test-Files.pm6 ├── p6doc.iml ├── resources └── i18n │ ├── de │ └── README.de.md │ ├── es │ └── README.es.md │ ├── fr │ └── README.fr.md │ ├── it │ └── README.it.md │ ├── jp │ └── README.jp.md │ ├── nl │ └── README.nl.md │ ├── pt │ └── README.pt.md │ └── zh │ ├── README.zh.md │ └── doc │ └── Language │ ├── 5to6-nutshell.zh.pod6 │ ├── 5to6-overview.zh.pod6 │ ├── 5to6-perlfunc.zh.pod6 │ ├── 5to6-perlop.zh.pod6 │ ├── 5to6-perlsyn.zh.pod6 │ ├── 5to6-perlvar.zh.pod6 │ ├── faq.zh.pod6 │ └── rb-nutshell.zh.pod6 ├── shippable.yml ├── t ├── 00-meta.t ├── 01-load.t ├── 02-pod-valid.t ├── 02-tests-valid.t ├── 03-pod6.t ├── 05-pod-convenience.t └── 07-tabs.t ├── template ├── footer.html ├── head.html ├── header.html └── search_template.js ├── type-graph.txt ├── util ├── Dockerfile ├── clean-spell ├── ignored-methods.txt ├── issue-with-all-pod6.p6 ├── list-missing-methods.p6 ├── missing-methods.p6 ├── missing-types.p6 ├── new-type.p6 ├── perl-nbsp.p6 ├── sync ├── sync-build-log ├── test-links.sh ├── to-raku.p6 ├── travis-build.sh ├── travis-test.sh ├── trigger-rebuild.txt ├── unskip.p6 ├── update-and-sync ├── update-and-test └── xt-recent.sh ├── writing-docs ├── CREATING-NEW-DOCS.md ├── EXAMPLES.md ├── SQUASHATHONS.md └── STYLEGUIDE.md └── xt ├── aspell.t ├── braces.t ├── camelia-invocations.t ├── code.pws ├── double-dots.t ├── duplicates.t ├── examples-compilation.t ├── headings.t ├── links-not-links.t ├── perl-nbsp.t ├── return-type.t ├── space-after-comma.t ├── trailing-whitespace.t ├── type-graph.t ├── word-variants.t └── words.pws /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | test-linux: 4 | docker: 5 | - image: antoniogamiz/documentable 6 | steps: 7 | - checkout 8 | - run: 9 | name: Test documentable 10 | command: | 11 | # test one build 12 | documentable start -a 13 | 14 | workflows: 15 | version: 2 16 | test-deploy: 17 | jobs: 18 | - test-linux 19 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .sass-cache/ 2 | .git/ 3 | .gitignore 4 | .travis.yml 5 | writing-docs 6 | build 7 | .github 8 | .precomp 9 | .pod-cache 10 | xt 11 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ## The problem 2 | 3 | 4 | ## Suggestions 5 | 6 | 7 | 24 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## The problem 2 | 3 | 4 | ## Solution provided 5 | 6 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | index.data 3 | *~ 4 | html/*.html 5 | html/css/app.css 6 | html/perl6.xhtml 7 | html/routine/ 8 | html/type/ 9 | html/op/ 10 | html/language/ 11 | html/programs/ 12 | html/syntax/ 13 | html/images/type-graph* 14 | html/js/search.js 15 | html/js/app.js 16 | .precomp 17 | precompiled 18 | assets/assetpack.db 19 | assets/cache 20 | .sass-cache/ 21 | links.txt 22 | links.tmp 23 | xt/aspell.pws 24 | highlights/node_modules 25 | **/npm-debug.log 26 | highlights/atom-language-perl6/ 27 | .DS_store 28 | highlights/package-lock.json 29 | .pod-cache 30 | retest 31 | build/ 32 | node_modules/ 33 | package-lock.json 34 | *.epub 35 | .idea 36 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: 2 | - minimal 3 | 4 | os: 5 | - linux 6 | 7 | dist: bionic 8 | 9 | cache: 10 | directories: 11 | - precompiled 12 | - html 13 | - highlights/node_modules 14 | - $HOME/.rakudobrew 15 | 16 | 17 | services: 18 | - docker 19 | 20 | fast_finish: true 21 | 22 | branches: 23 | except: 24 | - gh-pages 25 | 26 | before_install: 27 | - nvm install 7.2.1 28 | - nvm use 7.2.1 29 | 30 | install: 31 | - util/travis-build.sh 32 | 33 | script: 34 | - export CXX=$(command -v g++-4.8 >/dev/null 2>&1; if [ $? -eq 1 ]; then printf "g++"; else printf "g++-4.8"; fi) 35 | - $CXX --version 36 | - util/travis-test.sh 37 | 38 | matrix: 39 | include: 40 | - env: BUILDENV=docker 41 | -------------------------------------------------------------------------------- /Build.pm6: -------------------------------------------------------------------------------- 1 | # Since the p6doc pod is now moved from 'lib' to 'doc' in the distribution we 2 | # need this to install pod under .../share/perl6/doc 3 | # This fixes p6doc command line use. 4 | 5 | use v6; 6 | use File::Find; 7 | 8 | class Build { 9 | method build($workdir) { 10 | my $doc-dir = $workdir.IO.child('doc'); 11 | my $dest-pref = $*REPO.repo-chain.grep(/site/).first.prefix.child("doc"); 12 | mkdir($dest-pref) unless $dest-pref.d; 13 | 14 | my @files = find(dir => "$workdir/doc", type => 'file').list; 15 | my $copied-all = True; 16 | for @files -> $file { 17 | next if $file.basename eq 'HomePage.pod6'; 18 | 19 | my $rel-dest = $file.relative($doc-dir); 20 | my $abs-dest = IO::Path.new($rel-dest, :CWD($dest-pref)).absolute; 21 | 22 | mkdir($abs-dest.IO.parent) unless $abs-dest.IO.parent.d; 23 | 24 | say "Copying {$rel-dest} to {$abs-dest}"; 25 | 26 | copy($file, $abs-dest); 27 | $copied-all = False unless $abs-dest.IO.e; 28 | } 29 | 30 | # Zef considers the build to have passed only if a truthy value is returned. 31 | $copied-all; 32 | } 33 | method isa($what) { # Only needed for older panda compatibility 34 | return True if $what.^name eq 'Panda::Builder'; 35 | callsame; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jjmerelo/rakudo-nostar:latest 2 | 3 | RUN buildDeps=' \ 4 | build-essential \ 5 | cpanminus \ 6 | ' \ 7 | runtimeDeps=' \ 8 | graphviz \ 9 | make \ 10 | ruby-sass \ 11 | ' \ 12 | testDeps=' \ 13 | aspell \ 14 | ' \ 15 | \ 16 | && set -x \ 17 | && apt-get update \ 18 | && apt-get --yes --no-install-recommends install $buildDeps $runtimeDeps $testDeps \ 19 | && rm -rf /var/lib/apt/lists/* \ 20 | \ 21 | && cpanm -vn Mojolicious \ 22 | && n=/usr/local/bin/n \ 23 | && curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n > "$n" \ 24 | && chmod +x "$n" \ 25 | && n stable 26 | 27 | WORKDIR /perl6/doc 28 | COPY . . 29 | RUN zef install zef && zef update && zef install --deps-only . 30 | 31 | RUN make test && make html 32 | 33 | EXPOSE 3000 34 | 35 | CMD ["morbo", "-w", "assets/sass", "-w", "assets/js", "-w", "html/js/search.js", "-l", "http://0.0.0.0:3000", "app.pl"] 36 | -------------------------------------------------------------------------------- /META6.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "p6doc", 3 | "description": "Perl 6 documentation (tools and docs)", 4 | "version": "1.003", 5 | "perl": "6.*", 6 | "authors": [ 7 | "perl6" 8 | ], 9 | "auth": "perl6", 10 | "depends": [ 11 | "URI", 12 | "File::Temp", 13 | "JSON::Fast", 14 | "Pod::To::BigPage:ver<0.5.1+>", 15 | "Pod::To::HTML:ver<0.6.1+>", 16 | "OO::Monitors", 17 | "File::Find", 18 | "Test::META", 19 | "Perl6::TypeGraph" 20 | ], 21 | "build-depends": [ 22 | "File::Find" 23 | ], 24 | "provides": { 25 | "Pod::Cache": "lib/Pod/Cache.pm6", 26 | "Pod::Convenience": "lib/Pod/Convenience.pm6", 27 | "Pod::To::SectionFilter": "lib/Pod/To/SectionFilter.pm6", 28 | "Test-Files": "lib/Test-Files.pm6" 29 | }, 30 | "support": { 31 | "source": "git://github.com/perl6/doc.git" 32 | }, 33 | "license": "Artistic-2.0", 34 | "tags": [ 35 | "perl6", 36 | "pod6", 37 | "documentation", 38 | "reference" 39 | ], 40 | "source-url": "git://github.com/perl6/doc.git", 41 | "meta6": "0" 42 | } -------------------------------------------------------------------------------- /app-start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | morbo -w assets/sass -w assets/js -w html/js/search.js app.pl 3 | 4 | -------------------------------------------------------------------------------- /cpanfile: -------------------------------------------------------------------------------- 1 | requires 'CSS::Minifier::XS' => '0.09'; 2 | requires 'CSS::Sass' => '3.4.10'; 3 | requires 'File::Copy' => '0'; 4 | requires 'File::Temp' => '0.2304'; 5 | requires 'File::Spec::Functions' => '0'; 6 | requires 'IO::Socket::SSL' => '2.056'; 7 | requires 'JavaScript::Minifier::XS' => '0.11'; 8 | requires 'Mojo::File' => '0'; 9 | requires 'Mojolicious' => '== 7.31'; 10 | requires 'Mojolicious::Lite' => '0'; 11 | requires 'Mojolicious::Plugin::AssetPack' => '1.42'; 12 | requires 'strict' => '0'; 13 | requires 'warnings' => '0'; 14 | -------------------------------------------------------------------------------- /doc/404.pod6: -------------------------------------------------------------------------------- 1 | =begin Html 2 | 3 | 4 | 5 |

404: Page Not Found

6 | 7 |

8 | We're sorry, but the page you tried to reach cannot be found.

17 | 18 |

19 | 20 | =end Html 21 | 22 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 23 | -------------------------------------------------------------------------------- /doc/Native/int.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class int 4 | 5 | =SUBTITLE Native integer 6 | 7 | class int is Int { } 8 | 9 | This class is used to represent integers that are native to the compiler, 10 | operating system and architecture the interpreter is compiled in. 11 | 12 | More information in L as well as in 13 | the section on L. 14 | 15 | 16 | =end pod 17 | 18 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 19 | -------------------------------------------------------------------------------- /doc/Programs/README.md: -------------------------------------------------------------------------------- 1 | Attention contributors 2 | ====================== 3 | 4 | Files in this directory are sorted by file name to generate the index 5 | for the "Programs" tab (in contrast to the other tabs which are 6 | indexed in order by each file's "=TITLE" entry). 7 | -------------------------------------------------------------------------------- /doc/Type/AST.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class AST 4 | 5 | =SUBTITLE Abstract representation of a piece of source code 6 | 7 | class AST { } 8 | 9 | An C or I is a partially processed representation 10 | of a program. ASTs are return values of the C quoting construct, 11 | and are typically used within macros to generate code that is inserted 12 | in the calling location of the macro. 13 | 14 | There is no API defined for ASTs yet. Hopefully that will emerge as 15 | part of the work on macros. 16 | 17 | =end pod 18 | 19 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 20 | -------------------------------------------------------------------------------- /doc/Type/CX/Done.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Done 4 | 5 | =SUBTITLE Done control exception 6 | 7 | role CX::Done does X::Control { } 8 | 9 | A L to be used to 10 | indicate a supply block is finished by calling C. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "" 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Emit.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Emit 4 | 5 | =SUBTITLE Emit control exception 6 | 7 | role CX::Emit does X::Control { } 8 | 9 | A L to be used when 10 | emit is used inside a C block. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "" 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Last.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Last 4 | 5 | =SUBTITLE Last control exception 6 | 7 | role CX::Last does X::Control { } 8 | 9 | A L that is thrown 10 | when C is called. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "". Since this type of exception is to be 21 | consumed by type and not really by the content of the message, this is a generic 22 | message, similar to all other C exceptions. 23 | 24 | =end pod 25 | -------------------------------------------------------------------------------- /doc/Type/CX/Next.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Next 4 | 5 | =SUBTITLE Next control exception 6 | 7 | role CX::Next does X::Control { } 8 | 9 | A L that is triggered 10 | when C is called. 11 | 12 | =for code 13 | for ^10 { 14 | CONTROL { 15 | when CX::Next { say "We're next" }; 16 | } 17 | next if $_ %% 2; 18 | say "We're in $_"; 19 | } 20 | 21 | This will print: 22 | 23 | =for code :lang 24 | We're next 25 | We're in 1 26 | We're next 27 | We're in 3 28 | We're next 29 | We're in 5 30 | We're next 31 | We're in 7 32 | We're next 33 | We're in 9 34 | 35 | 36 | =head1 Methods 37 | 38 | =head2 method message 39 | 40 | Defined as: 41 | 42 | method message() 43 | 44 | Returns "" 45 | 46 | =end pod 47 | -------------------------------------------------------------------------------- /doc/Type/CX/Proceed.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Proceed 4 | 5 | =SUBTITLE Proceed control exception 6 | 7 | role CX::Proceed does X::Control { } 8 | 9 | A L to be used when 10 | C is used within C or C blocks. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "" 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Redo.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Redo 4 | 5 | =SUBTITLE Redo control exception 6 | 7 | role CX::Redo does X::Control { } 8 | 9 | A L thrown when 10 | C is called. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "". 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Return.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Return 4 | 5 | =SUBTITLE Return control exception 6 | 7 | role CX::Next does X::Control { } 8 | 9 | A L to be used when 10 | return is called from within a sub. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "" 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Succeed.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Succeed 4 | 5 | =SUBTITLE Succeed control exception 6 | 7 | role CX::Succeed does X::Control { } 8 | 9 | A L thrown when 10 | C is called from a C or C block. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "" 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Take.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Take 4 | 5 | =SUBTITLE Take control exception 6 | 7 | role CX::Take does X::Control { } 8 | 9 | A L triggered by 10 | C. 11 | 12 | =head1 Methods 13 | 14 | =head2 method message 15 | 16 | Defined as: 17 | 18 | method message() 19 | 20 | Returns "". 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/CX/Warn.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role CX::Warn 4 | 5 | =SUBTITLE Control exception warning 6 | 7 | role CX::Warn does X::Control { } 8 | 9 | A L triggered when C is called to warn about any 10 | incidence. 11 | 12 | =head1 Methods 13 | 14 | =head2 method new 15 | 16 | C objects are created when a warning is thrown in any block. 17 | 18 | 19 | =end pod 20 | -------------------------------------------------------------------------------- /doc/Type/Cancellation.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Cancellation 4 | 5 | =SUBTITLE Removal of a task from a Scheduler before normal completion 6 | 7 | my class Cancellation {} 8 | 9 | A low level part of the Raku L 10 | system. Some L objects return a C with the 11 | L<.cue|/type/Scheduler#method_cue> method which can be used to cancel the 12 | scheduled execution before normal completion. C is a 13 | boolean that is true after L<#cancel> is called. 14 | 15 | =head1 Methods 16 | 17 | =head2 method cancel 18 | 19 | Defined as: 20 | 21 | method cancel() 22 | 23 | Usage: 24 | 25 | =begin code 26 | Cancellation.cancel 27 | =end code 28 | 29 | Cancels the scheduled execution of a task before normal completion. 30 | 31 | =end pod 32 | 33 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/CurrentThreadScheduler.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class CurrentThreadScheduler 4 | 5 | =SUBTITLE Scheduler that synchronously executes code on the current thread 6 | 7 | =for code :skip-test 8 | class CurrentThreadScheduler does Scheduler {} 9 | 10 | C executes tasks on the current threads. This means 11 | that L blocks until the code has 12 | finished executing. 13 | 14 | =end pod 15 | 16 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 17 | -------------------------------------------------------------------------------- /doc/Type/Distribution.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("basic") 2 | 3 | =TITLE role Distribution 4 | 5 | =SUBTITLE Distribution 6 | 7 | role Distribution { } 8 | 9 | Interface for objects that provide API access mapping META6 data to the files 10 | its represents. Objects that fulfill the C role can be read by 11 | e.g. L. Generally a C provides 12 | read access to a set of modules and metadata. These may be backed by the 13 | filesystem (L, L) but could also read 14 | from an e.g. tar file or socket. 15 | 16 | =head1 Required Methods 17 | 18 | =head2 method meta 19 | 20 | method meta(--> Hash:D) { ... } 21 | 22 | Returns a Hash with the representation of the metadata. Please note that an 23 | actual C file does not need to exist, just a representation in that 24 | format. 25 | 26 | =head2 method content 27 | 28 | method content($name-path --> IO::Handle:D) { ... } 29 | 30 | Returns an C to the file represented by C<$name-path>. C<$name-path> 31 | is a relative path as it would be found in the metadata such as C 32 | or C. 33 | 34 | =end pod 35 | 36 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 37 | -------------------------------------------------------------------------------- /doc/Type/Distribution/Hash.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Distribution::Hash 4 | 5 | =SUBTITLE Distribution::Hash 6 | 7 | =for code :preamble 8 | class Distribution::Hash does Distribution::Locally { } 9 | 10 | A L implementation backed by the filesystem. It 11 | does not require a C file, essentially providing a lower level 12 | L|/type/Distribution::Path>. 13 | 14 | =head1 Methods 15 | 16 | =head2 method new 17 | 18 | method new($hash, :$prefix) 19 | 20 | Creates a new C instance from the metadata contained in 21 | C<$hash>. All paths in the metadata will be prefixed with C<:$prefix>. 22 | 23 | =head2 method meta 24 | 25 | method meta() 26 | 27 | Returns a Hash with the representation of the metadata. 28 | 29 | =head2 method content 30 | 31 | Please check 32 | L method in Distribution::Locally|/type/Distribution::Locally#method_content>. 33 | 34 | Returns an C to the file represented by C<$name-path>. C<$name-path> 35 | is a relative path as it would be found in the metadata such as C 36 | or C. 37 | 38 | =end pod 39 | 40 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 41 | -------------------------------------------------------------------------------- /doc/Type/Distribution/Locally.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Distribution::Locally 4 | 5 | =SUBTITLE Distribution::Locally 6 | 7 | role Distribution::Locally does Distribution { } 8 | 9 | Provides read access to specific files pointed at by a distributions metadata, 10 | providing the L 11 | method for L and 12 | L. 13 | 14 | =head1 Methods 15 | 16 | =head2 method prefix 17 | 18 | A prefix path to be used in conjuncture with the paths found in the metadata. 19 | 20 | =head2 method content 21 | 22 | Provides L 23 | 24 | Returns an C to the file represented by C<$name-path>. C<$name-path> 25 | is a relative path as it would be found in the metadata such as C 26 | or C, and these paths will be prefixed with 27 | L. 28 | 29 | =end pod 30 | 31 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 32 | -------------------------------------------------------------------------------- /doc/Type/Distribution/Path.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Distribution::Path 4 | 5 | =SUBTITLE Distribution::Path 6 | 7 | =for code :preamble 8 | class Distribution::Path does Distribution::Locally { } 9 | 10 | A L implementation backed by the filesystem. It requires a 11 | C file at its root. 12 | 13 | =head1 Methods 14 | 15 | =head2 method new 16 | 17 | method new(IO::Path $prefix, IO::Path :$meta-file = IO::Path) 18 | 19 | Creates a new C instance from the C file found 20 | at the given C<$prefix>, and from which all paths in the metadata will be 21 | prefixed with. C<:$meta-file> may optionally be passed if a filename other than 22 | C needs to be used. 23 | 24 | =head2 method meta 25 | 26 | method meta() 27 | 28 | Returns a Hash with the representation of the metadata. 29 | 30 | =head2 method content 31 | 32 | L 33 | 34 | Returns an C to the file represented by C<$name-path>. C<$name-path> 35 | is a relative path as it would be found in the metadata such as C 36 | or C. 37 | 38 | =end pod 39 | 40 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 41 | -------------------------------------------------------------------------------- /doc/Type/Distro.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Distro 4 | 5 | =SUBTITLE Distribution related information 6 | 7 | class Distro does Systemic { } 8 | 9 | Built-in class for providing distribution related information. Usually accessed 10 | through the L<$*DISTRO|/language/variables#index-entry-%24*DISTRO> dynamic 11 | variable. 12 | 13 | =head1 Methods 14 | 15 | =head2 method is-win 16 | 17 | Instance method returning a C indicating whether the distribution is a 18 | version of the Windows operating system. 19 | 20 | =head2 method path-sep 21 | 22 | Instance method returning the string that can be used to delimit elements in 23 | a path specification. 24 | 25 | =head2 method release 26 | 27 | Instance method returning the release information of the Distro object. Dies if 28 | the release information could not be established. 29 | 30 | =end pod 31 | 32 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 33 | -------------------------------------------------------------------------------- /doc/Type/Duration.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Duration 4 | 5 | =SUBTITLE Length of time 6 | 7 | class Duration is Cool does Real { } 8 | 9 | A C represents a length of time in atomic seconds, with 10 | fractions. Like an L, it is epoch-agnostic. 11 | 12 | Cs can be subtracted from or added to Cs to yield another, 13 | new C. Subtracting one C from another yields a C. A 14 | C can also result from mathematical operations between two 15 | Cs when it makes sense (namely, the addition, subtraction, or modulus 16 | of two Cs). It can also be added, subtracted or divided modulo L 17 | numbers. 18 | 19 | The type of object returned for other numeric operations is currently 20 | unspecified. 21 | 22 | =end pod 23 | 24 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/Encoding/Registry.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Encoding::Registry 4 | 5 | =SUBTITLE Management of available encodings 6 | 7 | class Encoding::Registry {} 8 | 9 | C is initialized with a list of encoding that is 10 | available for any Raku application, namely: 11 | 12 | =item C 13 | =item C 14 | =item C 15 | =item C 16 | =item C 17 | =item C, C 18 | =item C 19 | =item C, C, C, C, C, C, C, C, C, C 20 | =item C 21 | =item C 22 | =item C 23 | 24 | =head1 Methods 25 | 26 | =head2 method name 27 | 28 | method register(Encoding $enc --> Nil) 29 | 30 | Register a new L. 31 | 32 | X<|Encoding::Encoder> 33 | X<|Encoding::Decoder> 34 | =head2 method find 35 | 36 | method find(Str() $name) 37 | 38 | Finds an encoding by its name. Returns an C or 39 | C, depending on what had been registered. 40 | 41 | =end pod 42 | 43 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/Endian.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("enum") :category("basic") 2 | 3 | =TITLE enum Endian 4 | 5 | =SUBTITLE Indicate endianness (6.d, 2018.12 and later) 6 | 7 | enum Endian ; 8 | 9 | X<|NativeEndian> 10 | X<|LittleEndian> 11 | X<|BigEndian> 12 | X<|Endian> 13 | An enum for indicating endianness, specifically with methods on C and 14 | C. Consists of C, C and C. 15 | 16 | =head1 Methods 17 | 18 | =head2 routine Numeric 19 | 20 | multi method Numeric(Endian:D --> Int:D) 21 | 22 | Returns the value part of the C pair. 23 | 24 | say NativeEndian.Numeric; # OUTPUT: «0␤» 25 | say LittleEndian.Numeric; # OUTPUT: «1␤» 26 | say BigEndian.Numeric; # OUTPUT: «2␤» 27 | 28 | Note that the actual numeric values are subject to change. So please use 29 | the named values instead. 30 | 31 | =end pod 32 | 33 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 34 | -------------------------------------------------------------------------------- /doc/Type/FatRat.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class FatRat 4 | 5 | =SUBTITLE Rational number (arbitrary-precision) 6 | 7 | class FatRat is Cool does Rational[Int, Int] {} 8 | 9 | A C is a rational number stored with arbitrary size numerator and 10 | denominator. Arithmetic operations involving a C and optionally L 11 | or L objects return a C, avoiding loss of precision. 12 | 13 | Since, unlike L, FatRat arithmetics do not fall back L at some 14 | point, there is a risk that repeated arithmetic operations generate 15 | pathologically large numerators and denominators. 16 | 17 | There are two common ways to generate C objects: through the 18 | C constructor, which generates them from numerator and 19 | denominator, or by calling the C<.FatRat> method on an L or L 20 | object. 21 | 22 | =head1 Methods 23 | 24 | =head2 method perl 25 | 26 | multi method perl(FatRat:D: --> Str:D) 27 | 28 | Returns an implementation-specific string that produces an L object 29 | when given to L. 30 | 31 | say FatRat.new(1, 2).perl; # OUTPUT: «FatRat.new(1, 2)␤» 32 | 33 | =end pod 34 | 35 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/IO.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("domain-specific") 2 | 3 | =TITLE role IO 4 | 5 | =SUBTITLE Input/output related routines 6 | 7 | The role provides no methods, but exists so that C coercers, which 8 | coerce to L, correctly type-check the resultant value. The 9 | role is implemented by L and 10 | L. 11 | 12 | See also the related classes L and 13 | L. 14 | 15 | =end pod 16 | 17 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 18 | -------------------------------------------------------------------------------- /doc/Type/IO/Path/Cygwin.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Path::Cygwin 4 | 5 | =SUBTITLE IO::Path pre-loaded with IO::Spec::Cygwin 6 | 7 | class IO::Path::Cygwin is IO::Path { } 8 | 9 | This sub-class of L«C|/type/IO::Path», pre-loaded with 10 | L«C|/type/IO::Spec::Cygwin» in the C<$.SPEC> attribute. 11 | 12 | =head1 Methods 13 | 14 | =head2 method new 15 | 16 | Same as L«C|/type/IO::Path#method_new», except 17 | C<:$SPEC> cannot be set and defaults to 18 | L«C|/type/IO::Spec::Cygwin», regardless of the operating 19 | system the code is being run on. 20 | 21 | =head2 method perl 22 | 23 | Defined as: 24 | 25 | method perl(IO::Path::Cygwin:D: --> Str:D) 26 | 27 | Returns a string that, when given passed through L«C|/routine/EVAL» 28 | gives the original invocant back. 29 | 30 | IO::Path::Cygwin.new("foo/bar").perl.say; 31 | # OUTPUT: IO::Path::Cygwin.new("foo/bar", :CWD("/home/camelia")) 32 | 33 | Note that this string includes the value of the C<.CWD> attribute that is set 34 | to L«C<$*CWD>|/language/variables#Dynamic_variables» when the path 35 | object was created, by default. 36 | 37 | =end pod 38 | 39 | # vim: expandtab shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/IO/Path/QNX.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Path::QNX 4 | 5 | =SUBTITLE IO::Path pre-loaded with IO::Spec::QNX 6 | 7 | class IO::Path::QNX is IO::Path { } 8 | 9 | This sub-class of L«C|/type/IO::Path», pre-loaded with 10 | L«C|/type/IO::Spec::QNX» in the C<$.SPEC> attribute. 11 | 12 | =head1 Methods 13 | 14 | =head2 method new 15 | 16 | Same as L«C|/type/IO::Path#method_new», except 17 | C<:$SPEC> cannot be set and defaults to 18 | L«C|/type/IO::Spec::QNX», regardless of the operating system 19 | the code is being run on. 20 | 21 | =head2 method perl 22 | 23 | Defined as: 24 | 25 | method perl(IO::Path::QNX:D: --> Str:D) 26 | 27 | Returns a string that, when given passed through L«C|/routine/EVAL» 28 | gives the original invocant back. 29 | 30 | IO::Path::QNX.new("foo/bar").perl.say; 31 | # OUTPUT: IO::Path::QNX.new("foo/bar", :CWD("/home/camelia")) 32 | 33 | Note that this string includes the value of the C<.CWD> attribute that is set 34 | to L«C<$*CWD>|/language/variables#Dynamic_variables» when the path 35 | object was created, by default. 36 | 37 | =end pod 38 | 39 | # vim: expandtab shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/IO/Path/Unix.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Path::Unix 4 | 5 | =SUBTITLE IO::Path pre-loaded with IO::Spec::Unix 6 | 7 | class IO::Path::Unix is IO::Path { } 8 | 9 | This sub-class of L«C|/type/IO::Path», pre-loaded with 10 | L«C|/type/IO::Spec::Unix» in the C<$.SPEC> attribute. 11 | 12 | =head1 Methods 13 | 14 | =head2 method new 15 | 16 | Same as L«C|/type/IO::Path#method_new», except 17 | C<:$SPEC> cannot be set and defaults to 18 | L«C|/type/IO::Spec::Unix», regardless of the operating system 19 | the code is being run on. 20 | 21 | =head2 method perl 22 | 23 | Defined as: 24 | 25 | method perl(IO::Path::Unix:D: --> Str:D) 26 | 27 | Returns a string that, when given passed through L«C|/routine/EVAL» 28 | gives the original invocant back. 29 | 30 | IO::Path::Unix.new("foo/bar").perl.say; 31 | # OUTPUT: IO::Path::Unix.new("foo/bar", :CWD("/home/camelia")) 32 | 33 | Note that this string includes the value of the C<.CWD> attribute that is set 34 | to L«C<$*CWD>|/language/variables#Dynamic_variables» when the path 35 | object was created, by default. 36 | 37 | =end pod 38 | 39 | # vim: expandtab shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/IO/Path/Win32.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Path::Win32 4 | 5 | =SUBTITLE IO::Path pre-loaded with IO::Spec::Win32 6 | 7 | class IO::Path::Win32 is IO::Path { } 8 | 9 | This sub-class of L«C|/type/IO::Path», pre-loaded with 10 | L«C|/type/IO::Spec::Win32» in the C<$.SPEC> attribute. 11 | 12 | =head1 Methods 13 | 14 | =head2 method new 15 | 16 | Same as L«C|/type/IO::Path#method_new», except 17 | C<:$SPEC> cannot be set and defaults to 18 | L«C|/type/IO::Spec::Win32», regardless of the operating system 19 | the code is being run on. 20 | 21 | =head2 method perl 22 | 23 | Defined as: 24 | 25 | method perl(IO::Path::Win32:D: --> Str:D) 26 | 27 | Returns a string that, when given passed through L«C|/routine/EVAL» 28 | gives the original invocant back. 29 | 30 | IO::Path::Win32.new("foo/bar").perl.say; 31 | # OUTPUT: IO::Path::Win32.new("foo/bar", :CWD("C:\\Users\\camelia")) 32 | 33 | Note that this string includes the value of the C<.CWD> attribute that is set 34 | to L«C<$*CWD>|/language/variables#Dynamic_variables» when the path 35 | object was created, by default. 36 | 37 | =end pod 38 | 39 | # vim: expandtab shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/IO/Pipe.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Pipe 4 | 5 | =SUBTITLE Buffered inter-process string or binary stream 6 | 7 | class IO::Pipe is IO::Handle {} 8 | 9 | An C object closely corresponds to a UNIX pipe. It has one end where 10 | it consumes string or binary data, and another where it reproduces the same 11 | data. It is buffered, so that a write without a read doesn't immediately 12 | block. 13 | 14 | Pipes can be easily constructed with L. 15 | 16 | =head1 Methods 17 | 18 | =head2 method close 19 | 20 | Defined as: 21 | 22 | method close(IO::Pipe: --> Proc:D) 23 | 24 | Closes the pipe and returns L object from which the pipe originates. 25 | 26 | =head2 method IO 27 | 28 | Defined as: 29 | 30 | method IO(IO::Pipe: --> IO::Path:U) 31 | 32 | Returns an L type object. 33 | 34 | =head2 method path 35 | 36 | Defined as: 37 | 38 | method path(IO::Pipe: --> IO::Path:U) 39 | 40 | Returns an L type object. 41 | 42 | =head2 method proc 43 | 44 | Defined as: 45 | 46 | method proc(IO::Pipe: --> Proc:D) 47 | 48 | Returns the L object from which the pipe originates. 49 | 50 | =end pod -------------------------------------------------------------------------------- /doc/Type/IO/Spec.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class IO::Spec 4 | 5 | =SUBTITLE Platform specific operations on file and directory paths 6 | 7 | class IO::Spec { } 8 | 9 | Objects of this class are not used directly but as a sub-class specific to 10 | the platform perl is running on via the C<$*SPEC> variable which will contain 11 | an object of the appropriate type. 12 | 13 | The sub-classes are documented separately, with the platform-specific 14 | differences documented in L, L, 15 | L and L. 16 | 17 | B the C classes provide low-level path operations. Unless 18 | you're creating your own high-level path manipulation routines, you don't 19 | need to use C. Use L«C|/type/IO::Path» instead. 20 | 21 | B no special validation is done by these classes (e.g. check whether 22 | path contains a null character). It is the job of higher-level classes, like 23 | L«C|/type/IO::Path», to do that. 24 | 25 | =head1 Methods 26 | 27 | =end pod 28 | 29 | # vim: expandtab shiftwidth=4 ft=perl6 30 | -------------------------------------------------------------------------------- /doc/Type/Macro.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Macro 4 | 5 | =SUBTITLE Compile-time routine 6 | 7 | class Macro is Routine { } 8 | 9 | A macro is a Routine whose invocation typically happens during 10 | parsing. By returning an L, a macro can inject code into 11 | the calling location. 12 | 13 | =end pod 14 | 15 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/Metamodel/ConcreteRoleHOW.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("metamodel") 2 | 3 | =TITLE role Metamodel::ConcreteRoleHOW 4 | 5 | =SUBTITLE Provides an implementation of a concrete instance of a role 6 | 7 | class Metamodel::ConcreteRoleHOW 8 | does Metamodel::Naming 9 | does Metamodel::Versioning 10 | does Metamodel::PrivateMethodContainer 11 | does Metamodel::MethodContainer 12 | does Metamodel::MultiMethodContainer 13 | does Metamodel::AttributeContainer 14 | does Metamodel::RoleContainer 15 | does Metamodel::MultipleInheritance 16 | does Metamodel::ArrayType 17 | does Metamodel::Concretization {} 18 | 19 | You can use this to build roles, in the same way that C can be used to 20 | build classes: 21 | 22 | =for code 23 | my $a = Metamodel::ConcreteRoleHOW.new_type(name => "Bar"); 24 | $a.^compose; 25 | say $a.^roles; # OUTPUT: «(Mu)␤» 26 | 27 | The main difference with 28 | L|/type/Metamodel::ClassHOW#method_new_type> is that you 29 | can mix-in roles in this newly created one. 30 | 31 | This class is Rakudo specific, and provided only for completeness. Not really 32 | intended to be used by the final user. 33 | 34 | =end pod 35 | -------------------------------------------------------------------------------- /doc/Type/Metamodel/Finalization.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("metamodel") 2 | 3 | =TITLE role Metamodel::Finalization 4 | 5 | =SUBTITLE Metaobject supporting object finalization 6 | 7 | X<|DESTROY metamodel> 8 | 9 | role Metamodel::Finalization { ... } 10 | 11 | This role takes care that C submethods are called (if they 12 | exist) when an object is garbage-collected. 13 | 14 | =head1 Methods 15 | 16 | =head2 method setup_finalization 17 | 18 | method setup_finalization(Metamodel::Finalization:D: $obj) 19 | 20 | Collects the C submethods from this class and all its 21 | superclasses, and marks the class as needing action on garbage 22 | collection. 23 | 24 | A metamodel for a kind that implements finalization semantics must call 25 | this method at type composition time. 26 | 27 | =head2 method destroyers 28 | 29 | method destroyers(Metamodel::Finalization:D: $obj --> List:D) 30 | 31 | Returns a list of all finalization methods. 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/Metamodel/Naming.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("metamodel") 2 | 3 | =TITLE role Metamodel::Naming 4 | 5 | =SUBTITLE Metaobject that supports named types 6 | 7 | role Metamodel::Naming { } 8 | 9 | L role for (optionally) named things, like classes, 10 | roles and enums. 11 | 12 | =head1 Methods 13 | 14 | =head2 method name 15 | 16 | method name($type) 17 | 18 | Returns the name of the metaobject, if any. 19 | 20 | say 42.^name; # OUTPUT: «Int␤» 21 | 22 | =head2 method set_name 23 | 24 | method set_name($type, $new_name) 25 | 26 | Sets the new name of the metaobject. 27 | 28 | =end pod 29 | -------------------------------------------------------------------------------- /doc/Type/Metamodel/ParametricRoleGroupHOW.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("metamodel") 2 | 3 | =TITLE role Metamodel::ParametricRoleGroupHOW 4 | 5 | =SUBTITLE Represents a group of roles with different parameterizations 6 | 7 | class Metamodel::ParametricRoleGroupHOW 8 | does Metamodel::Naming 9 | does Metamodel::Documenting 10 | does Metamodel::Stashing 11 | does Metamodel::TypePretense 12 | does Metamodel::RolePunning 13 | does Metamodel::BoolificationProtocol {} 14 | 15 | A C groups a set of C, every one of them representing a single role declaration with their own parameter sets. 16 | 17 | =for code 18 | (role Zape[::T] {}).HOW.say; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤» 19 | Zape.HOW.say ; # OUTPUT: «Perl6::Metamodel::ParametricRoleGroupHOW.new␤» 20 | 21 | Cs need to be added to this kind of group: 22 | 23 | =for code 24 | my \zape := Metamodel::ParametricRoleGroupHOW.new_type( name => "zape"); 25 | my \zipi := Metamodel::ParametricRoleHOW.new_type( name => "zipi", group => zape); 26 | say zipi.HOW; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤» 27 | 28 | 29 | I: As most of the C classes, this class is here mainly for 30 | illustration purposes and it's not intended for the final user to instantiate. 31 | 32 | =end pod 33 | -------------------------------------------------------------------------------- /doc/Type/Metamodel/RoleContainer.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("metamodel") 2 | 3 | =TITLE role Metamodel::RoleContainer 4 | 5 | =SUBTITLE Metaobject that supports holding/containing roles 6 | 7 | role Metamodel::RoleContainer {} 8 | 9 | Implements the ability to hold roles to be held for composition. 10 | 11 | =for code :preamble 12 | class A does SomeRole {} 13 | 14 | roughly corresponds to 15 | 16 | =for code :preamble 17 | class A { 18 | BEGIN A.^add_role(SomeRole); 19 | } 20 | 21 | =head1 Methods 22 | 23 | =head2 method add_role 24 | 25 | method add_role(Metamodel::RoleContainer:D: $obj, Mu $role) 26 | 27 | Adds the C<$role> to the list of roles to be composed. 28 | 29 | =head2 method roles_to_compose 30 | 31 | method roles_to_compose(Metamodel::RoleContainer:D: $obj --> List:D) 32 | 33 | returns a list of roles added with C, which are to be composed 34 | at type composition time. 35 | 36 | =end pod 37 | -------------------------------------------------------------------------------- /doc/Type/Metamodel/RolePunning.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("metamodel") 2 | 3 | =TITLE role Metamodel::RolePunning 4 | 5 | =SUBTITLE Metaobject that supports I of roles. 6 | 7 | role Perl6::Metamodel::RolePunning {} 8 | 9 | Implements the ability to create objects from Cs without the intermediate 10 | need to use a class. Not intended to be used directly (will in fact error if 11 | it's Cd), but via punning of roles, as below. This is also Rakudo specific 12 | and not part of the spec. 13 | 14 | =for code 15 | role A { 16 | method b { 17 | return "punned" 18 | } 19 | }; 20 | my $a = A.new; 21 | say $a.b; # OUTPUT: «punned␤» 22 | 23 | =end pod 24 | -------------------------------------------------------------------------------- /doc/Type/Mixy.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("composite") 2 | 3 | =TITLE role Mixy 4 | 5 | =SUBTITLE Collection of distinct objects with Real weights 6 | 7 | role Mixy does Baggy { } 8 | 9 | A role for collections of weighted values. See L and L. 10 | C objects differ from L objects in that the weights of 11 | C are Ls rather than Ls. 12 | 13 | =head1 Methods 14 | 15 | =head2 method total 16 | 17 | method total(--> Real) 18 | 19 | Returns the sum of all the weights 20 | 21 | say mix('a', 'b', 'c', 'a', 'a', 'd').total == 6; # OUTPUT: «True␤» 22 | say %(a => 5.6, b => 2.4).Mix.total == 8; # OUTPUT: «True␤» 23 | 24 | =head2 method roll 25 | 26 | method roll($count = 1) 27 | 28 | Similar to a L.roll, but with C weights rather than integral 29 | ones. 30 | 31 | =head1 See Also 32 | 33 | L 34 | 35 | =end pod 36 | 37 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 -------------------------------------------------------------------------------- /doc/Type/NFC.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class NFC 4 | 5 | =SUBTITLE Codepoint string in Normal Form C (composed) 6 | 7 | class NFC is Uni {} 8 | 9 | A Codepoint string in Unicode Normalization Form C. It is created by Canonical Decomposition, 10 | followed by Canonical Composition. For more information on what this means, see 11 | L. 12 | 13 | =end pod 14 | 15 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 16 | -------------------------------------------------------------------------------- /doc/Type/NFD.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class NFD 4 | 5 | =SUBTITLE Codepoint string in Normal Form D (decomposed) 6 | 7 | class NFD is Uni {} 8 | 9 | A Codepoint string in the "D" L 10 | 11 | =end pod 12 | 13 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 14 | -------------------------------------------------------------------------------- /doc/Type/NFKC.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class NFKC 4 | 5 | =SUBTITLE Codepoint string in Normal Form KC (compatibility composed) 6 | 7 | class NFKC is Uni {} 8 | 9 | A Codepoint string in Unicode Normalization Form KC. It is created by Compatibility Decomposition, 10 | followed by Canonical Composition. For more information on what this means, see 11 | L. 12 | =end pod 13 | 14 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 15 | -------------------------------------------------------------------------------- /doc/Type/NFKD.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class NFKD 4 | 5 | =SUBTITLE Codepoint string in Normal Form KD (compatibility decomposed) 6 | 7 | class NFKD is Uni {} 8 | 9 | A Codepoint string in Unicode Normalization Form KD. It is created by Compatibility Decomposition. 10 | For more information on what this means, see L. 11 | 12 | =end pod 13 | 14 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 15 | -------------------------------------------------------------------------------- /doc/Type/ObjAt.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class ObjAt 4 | 5 | =SUBTITLE Unique identification for an object 6 | 7 | class ObjAt is Any {} 8 | 9 | Objects of type C are the return value of C<.WHICH> calls on other 10 | objects, and identify an object uniquely. 11 | 12 | If two objects compare equally via C<===>, their C<.WHICH> methods return 13 | the same ObjAt object. 14 | 15 | See also L for value types. 16 | 17 | =head1 Methods 18 | 19 | =head2 infix eqv 20 | 21 | Defined as: 22 | 23 | multi sub infix:(ObjAt:D $a, ObjAt:D $b) 24 | 25 | Returns True if the two ObjAt are the same, that is, if the object they identify 26 | is the same. 27 | 28 | my @foo = [2,3,1]; 29 | my @bar := @foo; 30 | say @foo.WHICH eqv @bar.WHICH; # OUTPUT: «True␤» 31 | 32 | =end pod 33 | 34 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 35 | -------------------------------------------------------------------------------- /doc/Type/Order.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("enum") :category("domain-specific") 2 | 3 | =TITLE enum Order 4 | 5 | =SUBTITLE Human readable form for comparison operators. 6 | X<|Less>X<|Same>X<|More> 7 | 8 | enum Order (:Less(-1), :Same(0), :More(1)); 9 | 10 | =head1 Operators 11 | 12 | =head2 infix cmp 13 | 14 | multi sub infix:(\a, \b --> Order:D) 15 | 16 | C will first try to compare operands as strings (via coercion to L), and, failing that, will try to compare numerically via the C«<=>» operator or any other type-appropriate comparison operator. See also L operator|/routine/cmp#(Operators)_infix_cmp>. 17 | 18 | =head2 infix <=> 19 | 20 | multi sub infix:«<=>»(Int:D \a, Int:D \b --> Order:D) 21 | 22 | Specialized form for Int. 23 | 24 | =end pod 25 | 26 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 27 | -------------------------------------------------------------------------------- /doc/Type/Perl.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Perl 4 | 5 | =SUBTITLE Perl related information 6 | 7 | class Perl does Systemic { } 8 | 9 | Built-in class for providing perl related information. Usually accessed 10 | through the L<$*PERL|/language/variables#index-entry-%24*PERL> dynamic variable. 11 | 12 | =head1 Methods 13 | 14 | =head2 method compiler 15 | 16 | Instance method returning the L object, of type 17 | L, associated with the Perl object. 18 | 19 | =head2 method DISTROnames 20 | 21 | Instance / Class method returning the names of the L 22 | objects that are supported by this version of Perl. 23 | 24 | =head2 method KERNELnames 25 | 26 | Instance / Class method returning the names of the L 27 | objects that are supported by this version of Perl. 28 | 29 | =head2 method VMnames 30 | 31 | Instance / Class method returning the names of the L objects that 32 | are supported by this version of Perl. 33 | 34 | =head1 See Also 35 | 36 | L, L. 37 | 38 | =end pod 39 | 40 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 41 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block 4 | 5 | =SUBTITLE Block in a Pod document 6 | 7 | class Pod::Block { } 8 | 9 | Class for a Pod block, and base class for most other Pod classes. 10 | 11 | A Pod block has contents (more pod blocks or strings) and a config hash. 12 | 13 | Useful subclasses: 14 | 15 | =begin table 16 | 17 | Class Used for 18 | ===== ======== 19 | Pod::Block::Para paragraphs 20 | Pod::Block::Named named blocks 21 | Pod::Block::Declarator declarator blocks 22 | Pod::Block::Code code blocks 23 | Pod::Block::Comment comments 24 | Pod::Block::Table =begin/end table 25 | tabular data 26 | Pod::Heading =head1 etc. headings 27 | Pod::Item list items 28 | Pod::Defn definition lists 29 | Pod::FormattingCode formatting codes 30 | 31 | =end table 32 | 33 | =head1 Methods 34 | 35 | =head2 method contents 36 | 37 | method contents(--> Positional:D) 38 | 39 | Returns a list of contents of this block. 40 | 41 | =head2 method config 42 | 43 | method config(--> Map:D) 44 | 45 | Returns a hash of configs. 46 | 47 | =end pod 48 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Code.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Code 4 | 5 | =SUBTITLE Verbatim code block in a Pod document 6 | 7 | class Pod::Block::Code is Pod::Block { } 8 | 9 | Class for a code (verbatim) Pod block. 10 | 11 | =head1 Methods 12 | 13 | =head2 method allowed 14 | 15 | method allowed(--> Positional:D) 16 | 17 | Returns a list of formatting codes that are allowed inside the code block. 18 | 19 | =end pod 20 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Comment.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Comment 4 | 5 | =SUBTITLE Comment in a Pod document 6 | 7 | class Pod::Block::Comment is Pod::Block { } 8 | 9 | Class for a Pod comment. 10 | 11 | =end pod 12 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Declarator.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Declarator 4 | 5 | =SUBTITLE Declarator block in a Pod document 6 | 7 | class Pod::Block::Declarator is Pod::Block { } 8 | 9 | Class for a declarator Pod block 10 | 11 | =head1 Methods 12 | 13 | =head2 method leading 14 | 15 | method leading(--> Str) 16 | 17 | Returns the leading Pod comment attached to the declarator 18 | 19 | =head2 method trailing 20 | 21 | method trailing(--> Str) 22 | 23 | Returns the trailing Pod comment attached to the declarator 24 | 25 | =head2 method WHEREFORE 26 | 27 | method WHEREFORE(--> Mu) 28 | 29 | Returns the code object or metaobject to which the Pod block is attached to 30 | 31 | =end pod 32 | 33 | # vim: expandtab shiftwidth=4 ft=perl6 34 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Named.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Named 4 | 5 | =SUBTITLE Named block in a Pod document 6 | 7 | class Pod::Block::Named is Pod::Block { } 8 | 9 | Class for a named Pod block. For example 10 | 11 | =begin code 12 | =begin MySection 13 | ... 14 | =end MySection 15 | =end code 16 | 17 | creates a C with name C. 18 | 19 | =head1 Methods 20 | 21 | =head2 method name 22 | 23 | method name(--> Str:D) 24 | 25 | Returns the name of the block. 26 | 27 | =end pod 28 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Para.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Para 4 | 5 | =SUBTITLE Paragraph in a Pod document 6 | 7 | class Pod::Block::Para is Pod::Block { } 8 | 9 | Class for a Pod paragraph. 10 | 11 | =end pod 12 | -------------------------------------------------------------------------------- /doc/Type/Pod/Block/Table.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Block::Table 4 | 5 | =SUBTITLE Table in a Pod document 6 | 7 | class Pod::Block::Table is Pod::Block { } 8 | 9 | Class for a table in a Pod document. 10 | 11 | =head1 Methods 12 | 13 | =head2 method caption 14 | 15 | method caption(--> Str:D) 16 | 17 | Returns the associated caption of the table. 18 | 19 | =head2 method headers 20 | 21 | method headers(--> Positional:D) 22 | 23 | Returns a list of table headers. If no headers have been defined the 24 | list is empty. 25 | 26 | =end pod 27 | -------------------------------------------------------------------------------- /doc/Type/Pod/Defn.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Defn 4 | 5 | =SUBTITLE Pod definition list 6 | 7 | class Pod::Defn is Pod::Block { } 8 | 9 | Class for definition lists in a Pod document. 10 | 11 | =head1 Methods 12 | 13 | =head2 method term 14 | 15 | method term(--> Mu) 16 | 17 | =end pod 18 | 19 | # vim: expandtab shiftwidth=4 ft=perl6 20 | -------------------------------------------------------------------------------- /doc/Type/Pod/FormattingCode.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::FormattingCode 4 | 5 | =SUBTITLE Pod formatting code 6 | 7 | class Pod::FormattingCode is Pod::Block { } 8 | 9 | Class for formatting codes in a Pod document. 10 | 11 | =head1 Methods 12 | 13 | =head2 method type 14 | 15 | method type(--> Mu) 16 | 17 | =head2 method meta 18 | 19 | method meta(--> Positional) 20 | 21 | =end pod 22 | 23 | # vim: expandtab shiftwidth=4 ft=perl6 24 | -------------------------------------------------------------------------------- /doc/Type/Pod/Heading.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Heading 4 | 5 | =SUBTITLE Heading in a Pod document 6 | 7 | class Pod::Heading is Pod::Block { } 8 | 9 | Class for headings in a Pod document. 10 | 11 | =head1 Methods 12 | 13 | =head2 method level 14 | 15 | method level(--> Int) 16 | 17 | Returns the level of the heading, starting at 1. 18 | 19 | =end pod 20 | -------------------------------------------------------------------------------- /doc/Type/Pod/Item.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Pod::Item 4 | 5 | =SUBTITLE Item in a Pod enumeration list 6 | 7 | class Pod::Item is Pod::Block { } 8 | 9 | Class for items in Pod enumeration lists. 10 | 11 | =head1 Methods 12 | 13 | =head2 method level 14 | 15 | method level(--> Int) 16 | 17 | Returns the level of the enumeration list, starting at 1. 18 | 19 | =end pod 20 | -------------------------------------------------------------------------------- /doc/Type/Proxy.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Proxy 4 | 5 | =SUBTITLE Item container with custom storage and retrieval 6 | 7 | class Proxy {} 8 | 9 | A Proxy is an object that allows you to set a hook that executes whenever a 10 | value is retrieved from a container (C) or when it is set (C). 11 | Please note that C can introduce mutability at places where it would 12 | break behavior, e.g. in C keys. 13 | 14 | To create a container that returns twice what was stored in it, you do something 15 | like this: 16 | 17 | sub double() is rw { 18 | my $storage = 0; 19 | Proxy.new( 20 | FETCH => method () { $storage * 2 }, 21 | STORE => method ($new) { $storage = $new }, 22 | ) 23 | } 24 | my $doubled := double(); 25 | $doubled = 4; 26 | say $doubled; # OUTPUT: «8␤» 27 | 28 | =head1 Methods 29 | 30 | =head2 method new 31 | 32 | method new(:&FETCH!, :&STORE! --> Proxy:D) 33 | 34 | Creates a new C object. C<&FETCH> is called with one argument (the 35 | proxy object) when the value is accessed, and must return the value that the 36 | fetch produces. C<&STORE> is called with two arguments (the proxy object, and 37 | the new value) when a new value is stored in the container. 38 | 39 | =end pod 40 | 41 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 42 | -------------------------------------------------------------------------------- /doc/Type/PseudoStash.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class PseudoStash 4 | 5 | =SUBTITLE Stash type for pseudo-packages 6 | 7 | class PseudoStash is Map { } 8 | 9 | C is the stash type (hanging off C<.WHO>) that backs 10 | various pseudo-packages. So, when you do C or C, that 11 | gives back a C. In most cases, C gives 12 | back a C. Neither of these are objects the user is expected to 13 | create by themselves, but in case you have one, you can just use it like a 14 | hash. 15 | 16 | =for code 17 | my $a = 42; 18 | my $b = q/$a/; 19 | say MY::{$b}; 20 | #OUTPUT: «42␤» 21 | 22 | This shows how you can use a C to look up variables, by name, 23 | at runtime. 24 | 25 | =end pod 26 | 27 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 28 | -------------------------------------------------------------------------------- /doc/Type/Routine/WrapHandle.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Routine::WrapHandle 4 | 5 | =SUBTITLE Holds all information needed to unwrap a wrapped routine. 6 | 7 | class WrapHandle { ... } 8 | 9 | C is a I created and returned by 10 | L. Its only use is to unwrap wrapped routines. 11 | Either call L on a routine object or call 12 | the method C on a C object. 13 | 14 | sub f() { say 'f was called' } 15 | my $wrap-handle = &f.wrap({ say 'before'; callsame; say 'after' }); 16 | f; # OUTPUT: «before␤f was called␤after␤» 17 | $wrap-handle.restore; 18 | f; # OUTPUT: «f was called␤» 19 | 20 | As such private class, it may suffer any kind of changes without prior notice. 21 | It is only mentioned here since it is visible by the user who checks the return 22 | type of the C method. 23 | 24 | =head1 Methods 25 | 26 | =head2 method restore 27 | 28 | method restore(--> Bool:D) 29 | 30 | Unwraps a wrapped routine and returns C on success. 31 | 32 | =end pod 33 | 34 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 35 | -------------------------------------------------------------------------------- /doc/Type/Sequence.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("basic") 2 | 3 | =TITLE class Sequence 4 | 5 | =SUBTITLE Operations for higher-level sequences 6 | 7 | class Sequence does PositionalBindFailover { } 8 | 9 | A C implements a series of methods for converting hight-level 10 | Cs into different types of objects, from positional to other. 11 | 12 | =head1 Methods 13 | 14 | 15 | TBD 16 | 17 | =end pod 18 | 19 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 20 | -------------------------------------------------------------------------------- /doc/Type/Stringy.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("basic") 2 | 3 | =TITLE role Stringy 4 | 5 | =SUBTITLE String or object that can act as a string 6 | 7 | role Stringy { ... } 8 | 9 | Common role for string types (such as Str). 10 | 11 | =end pod 12 | 13 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 14 | -------------------------------------------------------------------------------- /doc/Type/Submethod.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Submethod 4 | 5 | =SUBTITLE Member function that is not inherited by subclasses 6 | 7 | class Submethod is Routine {} 8 | 9 | A Submethod is a method that is not inherited by child classes. They are 10 | typically used for per-class initialization and tear-down tasks which 11 | are called explicitly per class in an inheritance tree, usually for 12 | enforcing a particular order. For example object construction with the 13 | C submethod happens from the least-derived to most-derived, so 14 | that the most-derived (child) classes can depend on the parent already 15 | being initialized. 16 | 17 | Submethods are of type C, and are declared with the 18 | C declarator: 19 | 20 | class Area { 21 | has $.size; 22 | submethod BUILD(:$x, :$y, :$z) { 23 | $!size = $x * $y * $z; 24 | } 25 | } 26 | 27 | =head1 Methods 28 | 29 | =head2 method gist 30 | 31 | Defined as: 32 | 33 | multi method gist(Submethod:D:) 34 | 35 | Returns the name of the submethod. 36 | 37 | =end pod 38 | 39 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/Supplier/Preserving.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Supplier::Preserving 4 | 5 | =SUBTITLE Cached live Supply factory 6 | 7 | class Supplier::Preserving is Supplier { } 8 | 9 | This is a factory for live L-type objects, and it 10 | provides the mechanism for emitting new values onto the supplies, whereby 11 | values are kept when no consumer has tapped into the C. Any tapping 12 | will consume the already stored and future values. 13 | 14 | Starting a preserving C and consuming its values after it is C: 15 | 16 | my $p = Supplier::Preserving.new; 17 | start for ^3 { 18 | $p.emit($_); 19 | LAST { 20 | say „done after { now - BEGIN now}s“; 21 | $p.done; 22 | } 23 | } 24 | sleep 2; 25 | react { 26 | whenever $p.Supply { $_.say; } 27 | whenever Promise.in(2) { done } 28 | } 29 | say „also done after { now - BEGIN now }s“ 30 | 31 | Will output: 32 | 33 | =for code :lang 34 | done after 0.0638467s 35 | 0 36 | 1 37 | 2 38 | also done after 4.0534119s 39 | 40 | =head1 Methods 41 | 42 | =head2 method new 43 | 44 | method new() 45 | 46 | The C constructor. 47 | 48 | =end pod 49 | -------------------------------------------------------------------------------- /doc/Type/Tap.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class Tap 4 | 5 | =SUBTITLE Subscription to a Supply 6 | 7 | class Tap {} 8 | 9 | A Tap is a subscription to a L. 10 | 11 | my $s = Supplier.new; 12 | my $tap = $s.Supply.on-close({ say "Tap closed" }).tap( 13 | -> $v { say "the value is $v" }, 14 | done => { say "Supply is done" }, 15 | quit => -> $ex { say "Supply finished with error $ex" }, 16 | ); 17 | 18 | # later 19 | $tap.close; 20 | 21 | =head1 Methods 22 | 23 | =head2 method close 24 | 25 | method close(Tap:D:) 26 | 27 | Closes the tap. 28 | 29 | =end pod 30 | 31 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 32 | -------------------------------------------------------------------------------- /doc/Type/Telemetry/Instrument/Thread.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Telemetry::Instrument::Thread 4 | 5 | =SUBTITLE Instrument for collecting Thread data 6 | 7 | class Telemetry::Instrument::Thread { } 8 | 9 | B This class is a Rakudo-specific feature and not standard Raku. 10 | 11 | Objects of this class are generally not created by themselves, but rather 12 | through making a Lshot. 13 | 14 | This class provides the following data points (in alphabetical order): 15 | 16 | =item tad 17 | 18 | The number of threads that ended with an exception (Bhreads-BborteB). 19 | 20 | =item tcd 21 | 22 | The number of threads that completed without any problem 23 | (Bhreads-BompleteB). 24 | 25 | =item thid 26 | 27 | Highest OS thread ID seen (Bhread-Bighest-B). 28 | 29 | =item tjd 30 | 31 | The number of threads that were joined (Bhreads-BoineB). 32 | 33 | =item tsd 34 | 35 | The number of threads that were started (Bhreads-BtarteB). 36 | 37 | =item tyd 38 | 39 | The number of times a thread was yielded (Bhreads-BieldeB). 40 | 41 | =end pod 42 | 43 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 44 | -------------------------------------------------------------------------------- /doc/Type/Telemetry/Period.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class Telemetry::Period 4 | 5 | =SUBTITLE Performance data over a period 6 | 7 | =begin code :preamble 8 | class Telemetry::Period is Telemetry { } 9 | =end code 10 | 11 | B This class is a Rakudo-specific feature and not standard Raku. 12 | 13 | =begin code 14 | # basic usage 15 | use Telemetry; 16 | my $t0 = Telemetry.new; 17 | # execute some code 18 | my $t1 = Telemetry.new; 19 | my $period = $t1 - $t0; # creates Telemetry::Period object 20 | say "Code took $period microseconds to execute"; 21 | =end code 22 | 23 | A C object contains the difference between two 24 | L objects. It is generally not created by calling 25 | .new, but it can be if needed. For all practical purposes, it is the same as 26 | the C object, but the B of the values is different (and 27 | the values are generally much smaller, as they usually are the difference of 28 | two big values of the C objects from which it was created). 29 | 30 | =end pod 31 | 32 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 33 | -------------------------------------------------------------------------------- /doc/Type/ThreadPoolScheduler.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class ThreadPoolScheduler 4 | 5 | =SUBTITLE Scheduler that distributes work among a pool of threads 6 | 7 | =begin code :skip-test 8 | class ThreadPoolScheduler does Scheduler {} 9 | =end code 10 | 11 | The C has a range of number of threads that it maintains, 12 | and it distributes work among those threads. When the upper limit of threads 13 | isn't reached yet, and there is work pending, it spawns new threads to handle 14 | the work. 15 | 16 | =head1 Methods 17 | 18 | =head2 new 19 | 20 | method new(Int :$initial_threads = 0, Int :$max_threads=16) 21 | 22 | Creates a new C object with the given range of threads to 23 | maintain. 24 | 25 | =end pod 26 | 27 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 28 | -------------------------------------------------------------------------------- /doc/Type/UInt.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE Subset UInt 4 | 5 | =SUBTITLE Unsigned integer (arbitrary-precision) 6 | 7 | The C is defined as a subset of C: 8 | 9 | =for code 10 | my subset UInt of Int where {not .defined or $_ >= 0}; 11 | 12 | Consequently, it cannot be instantiated or subclassed; however, that shouldn't affect most normal uses. 13 | 14 | Some examples of its behavior and uses: 15 | 16 | say UInt ~~ Int; # OUTPUT: «True␤» 17 | my UInt $u = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff; # 64-bit unsigned value 18 | say $u.base(16); # OUTPUT: «FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF␤» (32 digits) 19 | ++$u; 20 | say $u.base(16); # OUTPUT: «100000000000000000000000000000000␤» (33 digits!) 21 | my Int $i = $u; 22 | say $i.base(16); # same as above 23 | say $u.^name; # OUTPUT: «Int␤» - UInt is a subset, so the type is still Int. 24 | say $i.^name; # OUTPUT: «Int␤» 25 | # Difference in assignment 26 | my UInt $a = 5; # nothing wrong 27 | my UInt $b = -5; # Exception about failed type check 28 | my UInt $c = 0; 29 | --$c; # Exception again 30 | CATCH { default { put .^name, ': ', .Str } }; 31 | # OUTPUT: «X::TypeCheck::Assignment: Type check failed in assignment to $b; expected UInt but got Int (-5)␤» 32 | 33 | # Non-assignment operations are fine 34 | my UInt $d = 0; 35 | say $d - 3; # OUTPUT: «-3␤» 36 | 37 | =end pod 38 | 39 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/VM.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("domain-specific") 2 | 3 | =TITLE class VM 4 | 5 | =SUBTITLE Raku Virtual Machine related information 6 | 7 | class VM does Systemic { } 8 | 9 | Built-in class for providing information about the virtual machine in which 10 | Raku is running. Usually accessed through the 11 | L<$*VM|/language/variables#index-entry-%24*VM> dynamic variable. 12 | 13 | =head1 Methods 14 | 15 | 16 | =head2 method osname 17 | 18 | Defined as: 19 | 20 | multi method osname(VM:U:) 21 | multi method osname(VM:D:) 22 | 23 | Instance / Class method returning the name of the Operating System, as known 24 | by the configuration of the VM object / currently running virtual machine. 25 | 26 | =head2 method precomp-ext 27 | 28 | Instance method returning a string of the extension that should be used for 29 | precompiled files of the VM object. 30 | 31 | =head2 method precomp-target 32 | 33 | Instance method returning a string of the value of the compilation target 34 | that should be used when precompiling source-files with the VM object. 35 | 36 | =head2 method prefix 37 | 38 | Instance method returning a string of the path in which the virtual machine 39 | of the VM object is installed. 40 | 41 | =end pod 42 | 43 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 44 | -------------------------------------------------------------------------------- /doc/Type/ValueObjAt.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("basic") 2 | 3 | =TITLE class ValueObjAt 4 | 5 | =SUBTITLE Unique identification for value types 6 | 7 | class ValueObjAt is ObjAt { } 8 | 9 | A subclass of L|/type/ObjAt> that should be used to indicate that a class 10 | produces objects that are value types (in other words: are immutable after 11 | they have been initialized. 12 | 13 | my %h = a => 42; # mutable Hash 14 | say %h.WHICH; # OUTPUT: «ObjAt.new("Hash|1402...888")␤» 15 | 16 | my %m is Map = a => 42; # immutable Map 17 | say %m.WHICH; # OUTPUT: «ValueObjAt.new("Map|AAF...09F61F")␤» 18 | 19 | If you create a class that should be considered a value type, you should add 20 | a C method to that class that returns a C object, for 21 | instance: 22 | 23 | class YourClass { 24 | has $.foo; # note these are not mutable 25 | has $.bar; 26 | 27 | method WHICH() { 28 | ValueObjAt.new("YourClass|$!foo|$!bar"); 29 | } 30 | } 31 | 32 | Note that it is customary to always start the identifying string with the 33 | name of the object, followed by a "|". This to prevent confusion with other 34 | classes that may generate similar string values: the name of the class should 35 | then be enough of a differentiator to prevent collisions. 36 | 37 | =end pod 38 | 39 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /doc/Type/X/Anon/Augment.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Anon::Augment 4 | 5 | =SUBTITLE Compilation error due to augmenting an anonymous package 6 | 7 | class X::Anon::Augment does X::Comp { } 8 | 9 | Compile time error thrown when trying to augment an anonymous package. 10 | 11 | For example 12 | 13 | =for code :skip-test 14 | use MONKEY-TYPING; 15 | augment class { } 16 | 17 | Dies with 18 | 19 | =for code :lang 20 | Cannot augment anonymous class 21 | 22 | =head1 Methods 23 | 24 | =head2 method package-kind 25 | 26 | method package-kind returns Str:D 27 | 28 | Returns the kind of package (module, class, grammar, ...) that the code 29 | tried to augment. 30 | 31 | =end pod 32 | -------------------------------------------------------------------------------- /doc/Type/X/Anon/Multi.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Anon::Multi 4 | 5 | =SUBTITLE Compilation error due to declaring an anonymous multi 6 | 7 | class X::Anon::Multi does X::Comp { } 8 | 9 | Compile time error thrown when an anonymous multi is being declared. 10 | 11 | For example 12 | 13 | =for code :skip-test 14 | multi method () { } 15 | 16 | dies with 17 | 18 | =for code :lang 19 | Cannot put multi on anonymous method 20 | 21 | =head1 Methods 22 | 23 | =head2 method multiness 24 | 25 | method multiness(--> Str:D) 26 | 27 | Returns a string describing the multiness that the original code used, for 28 | example C<"multi"> or C<"proto">. 29 | 30 | =head2 method routine-type 31 | 32 | method routine-type(--> Str:D) 33 | 34 | Returns a string describing the type of routine that was declared, for example 35 | C<"sub"> or C<"method">. 36 | 37 | =end pod 38 | -------------------------------------------------------------------------------- /doc/Type/X/Assignment/RO.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Assignment::RO 4 | 5 | =SUBTITLE Exception thrown when trying to assign to something read-only 6 | 7 | class X::Assignment::RO is Exception {} 8 | 9 | Code like 10 | 11 | sub f() { 42 }; 12 | f() = 'new value'; # throws an X::Assignment::RO 13 | CATCH { default { put .^name, ': ', .Str } }; 14 | # OUTPUT: «X::Assignment::RO: Cannot modify an immutable Any␤» 15 | 16 | throws an exception of type C. 17 | 18 | =head1 Methods 19 | 20 | =head2 method typename 21 | 22 | method typename(X::Assignment::RO:D: --> Str) 23 | 24 | Returns the type name of the value on the left-hand side 25 | 26 | =end pod 27 | -------------------------------------------------------------------------------- /doc/Type/X/Attribute/NoPackage.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Attribute::NoPackage 4 | 5 | =SUBTITLE Compilation error due to declaring an attribute outside of a package 6 | 7 | class X::Attribute::NoPackage does X::Comp { } 8 | 9 | Compile time error thrown when an attribute is declared where it does 10 | not make sense (for example in the mainline). 11 | 12 | For example 13 | 14 | =for code 15 | has $.x; 16 | 17 | Dies with 18 | 19 | =for code :lang 20 | You cannot declare attribute '$.x' here; maybe you'd like a class or a role? 21 | 22 | =head1 Methods 23 | 24 | =head2 method name 25 | 26 | method name(--> Str:D) 27 | 28 | Returns the name of the attribute 29 | 30 | =end pod 31 | -------------------------------------------------------------------------------- /doc/Type/X/Attribute/Package.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Attribute::Package 4 | 5 | =SUBTITLE Compilation error due to declaring an attribute in an ineligible package 6 | 7 | class X::Attribute::Package does X::Comp { } 8 | 9 | Compile time error, thrown when the compiler encounters an attribute 10 | declaration inside a package that does not support attributes. 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | module A { has $.x } 16 | 17 | dies with 18 | 19 | =for code :lang 20 | A module cannot have attributes, but you tried to declare '$.x' 21 | 22 | =head1 Methods 23 | 24 | =head2 method name 25 | 26 | method name(--> Str:D) 27 | 28 | Returns the name of the attribute that triggered this error. 29 | 30 | =head2 method package-kind 31 | 32 | method package-kind(--> Str:D) 33 | 34 | Returns the kind of package (package, module) that doesn't support attributes. 35 | 36 | =end pod 37 | -------------------------------------------------------------------------------- /doc/Type/X/Attribute/Required.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Attribute::Required 4 | 5 | =SUBTITLE Compilation error due to not declaring an attribute with the C trait 6 | 7 | class X::Attribute::NoPackage does X::MOP { } 8 | 9 | Compile time error thrown when a required attribute is not assigned when 10 | creating an object. 11 | 12 | For example 13 | 14 | =for code 15 | my class Uses-required { 16 | has $.req is required 17 | }; 18 | my $object = Uses-required.new() 19 | 20 | Dies with 21 | 22 | =for code :lang 23 | OUTPUT: «(exit code 1) The attribute '$!req' is required, but you did not provide a value for it.␤» 24 | 25 | =head1 Methods 26 | 27 | =head2 method name 28 | 29 | method name(--> Str:D) 30 | 31 | Returns the name of the attribute. 32 | 33 | =head2 method why 34 | 35 | method why(--> Str:D) 36 | 37 | Returns the reason why that attribute is required, and it will be included in 38 | the message if provided. That reason is taken directly from the C 39 | trait. 40 | 41 | =for code :skip-test 42 | my class Uses-required { 43 | has $.req is required("because yes") 44 | }; 45 | my $object = Uses-required.new(); │ 46 | # OUTPUT: 47 | # «(exit code 1) The attribute '$!req' is required because because yes,␤ 48 | # but you did not provide a value for it.␤» 49 | 50 | 51 | 52 | =end pod 53 | -------------------------------------------------------------------------------- /doc/Type/X/Attribute/Undeclared.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Attribute::Undeclared 4 | 5 | =SUBTITLE Compilation error due to an undeclared attribute 6 | 7 | class X::Attribute::Undeclared is X::Undeclared { } 8 | 9 | Thrown when code refers to an attribute that has not been declared. 10 | 11 | For example the code 12 | 13 | =for code :skip-test 14 | class A { method m { $!notthere } } 15 | 16 | Produces the error 17 | 18 | =for code :lang 19 | Attribute $!notthere not declared in class A 20 | 21 | =head1 Methods 22 | 23 | =head2 method package-kind 24 | 25 | Returns the kind of package the attribute was used in (for example C, 26 | C) 27 | 28 | =head2 method package-name 29 | 30 | Returns the name of the package in which the offensive attribute reference 31 | was performed. 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/X/Augment/NoSuchType.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Augment::NoSuchType 4 | 5 | =SUBTITLE Compilation error due to augmenting a non-existing type 6 | 7 | class X::Augment::NoSuchType does X::Comp { } 8 | 9 | Thrown when trying to augment a type which doesn't exist. 10 | 11 | For example 12 | 13 | =for code :skip-test 14 | use MONKEY-TYPING; 15 | augment class NoSuch { } 16 | 17 | dies with 18 | 19 | =for code :lang 20 | You tried to augment class NoSuch, but it does not exist 21 | 22 | =head1 Methods 23 | 24 | =head2 method package-kind 25 | 26 | method package-kind(--> Str:D) 27 | 28 | Returns the kind of package (class, grammar) that is being tried to augment 29 | 30 | =head2 method package 31 | 32 | Returns the name that was tried to augment, but which doesn't exist. 33 | 34 | =end pod 35 | -------------------------------------------------------------------------------- /doc/Type/X/Bind.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Bind 4 | 5 | =SUBTITLE Error due to binding to something that is not a variable or container 6 | 7 | class X::Bind is Exception {} 8 | 9 | If you write code like this: 10 | 11 | =begin code :skip-test 12 | floor(1.1) := 42; 13 | =end code 14 | 15 | it dies with an C exception: 16 | 17 | =begin code :lang 18 | Cannot use bind operator with this left-hand side 19 | =end code 20 | 21 | =end pod 22 | -------------------------------------------------------------------------------- /doc/Type/X/Bind/NativeType.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Bind::NativeType 4 | 5 | =SUBTITLE Compilation error due to binding to a natively typed variable 6 | 7 | class X::Bind::NativeType does X::Comp { } 8 | 9 | Compile-time error thrown when trying to bind to a natively typed variable. 10 | 11 | Since native variables explicitly don't have the concept of a container at 12 | runtime, it does not make sense to support both binding and assignment; 13 | Raku supports only assignment (which makes more sense, because native 14 | types are value types). 15 | 16 | For example the code 17 | 18 | =for code :skip-test 19 | my int $x := 3; 20 | 21 | dies with 22 | 23 | =for code :lang 24 | Cannot bind to natively typed variable '$x'; use assignment instead 25 | 26 | and can be fixed by writing it as 27 | 28 | my int $x = 3; 29 | 30 | =head1 Methods 31 | 32 | =head2 method name 33 | 34 | method name(--> Str:D) 35 | 36 | Returns the name of the variable. 37 | 38 | =end pod 39 | -------------------------------------------------------------------------------- /doc/Type/X/Bind/Slice.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Bind::Slice 4 | 5 | =SUBTITLE Error due to binding to a slice 6 | 7 | class X::Bind::Slice is Exception {} 8 | 9 | When you try to bind to an array or hash slice: 10 | 11 | my @a; @a[0, 1] := [42]; 12 | CATCH { default { put .^name, ': ', .Str } }; 13 | # OUTPUT: «X::Bind::Slice: Cannot bind to Array slice␤» 14 | 15 | and 16 | 17 | my %h; %h := {}; 18 | CATCH { default { put .^name, ': ', .Str } }; 19 | # OUTPUT: «X::Bind::Slice: Cannot bind to Hash slice␤» 20 | 21 | you get an exception of type X<::Bind::Slice> 22 | 23 | =head1 Methods 24 | 25 | =head2 method type 26 | 27 | method type(X::Bind::Slice:D:) 28 | 29 | returns the type object of the thing that you tried to slice-bind, for example 30 | L, L or L. 31 | 32 | =end pod 33 | -------------------------------------------------------------------------------- /doc/Type/X/Caller/NotDynamic.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Caller::NotDynamic 4 | 5 | =SUBTITLE Error while trying to access a non dynamic variable through CALLER 6 | 7 | class X::Caller::NotDynamic is Exception { } 8 | 9 | Thrown when trying to access a non dynamic variable through CALLER 10 | 11 | A typical error message is 12 | 13 | =for code :lang 14 | Cannot access '$x' through CALLER, because it is not declared as dynamic 15 | 16 | =head1 Methods 17 | 18 | =head2 method symbol 19 | 20 | Returns the name of the symbol that was passed to CALLER. 21 | 22 | =end pod 23 | -------------------------------------------------------------------------------- /doc/Type/X/Channel/ReceiveOnClosed.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Channel::ReceiveOnClosed 4 | 5 | =SUBTITLE Error due to calling receive on a closed channel 6 | 7 | class X::Channel::ReceiveOnClosed {} 8 | 9 | This exception is thrown when a calling C on a L that has been closed: 10 | 11 | my $s = Channel.new; 12 | $s.close; 13 | $s.receive; # Cannot receive a message on a closed channel 14 | CATCH { default { put .^name, ': ', .Str } }; 15 | # OUTPUT: «X::Channel::ReceiveOnClosed: Cannot receive a message on a closed channel␤» 16 | 17 | =head1 Methods 18 | 19 | =head2 method channel 20 | 21 | method Channel(X::Channel::ReceiveOnClosed:D: --> Channel:D) 22 | 23 | Returns the Channel object on which the C method was called. 24 | 25 | =end pod 26 | -------------------------------------------------------------------------------- /doc/Type/X/Channel/SendOnClosed.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Channel::SendOnClosed 4 | 5 | =SUBTITLE Error due to calling send on a closed channel 6 | 7 | class X::Channel::SendOnClosed {} 8 | 9 | This exception is thrown when a calling C on a L that has been closed: 10 | 11 | my $s = Channel.new; 12 | $s.close; 13 | $s.send(42); 14 | CATCH { default { put .^name, ': ', .Str } }; 15 | # OUTPUT: «X::Channel::SendOnClosed: Cannot send a message on a closed channel␤» 16 | 17 | =head1 Methods 18 | 19 | =head2 method channel 20 | 21 | method Channel(X::Channel::SendOnClosed:D: --> Channel:D) 22 | 23 | Returns the Channel object on which the C method was called. 24 | 25 | =end pod 26 | -------------------------------------------------------------------------------- /doc/Type/X/Comp.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("exception") 2 | 3 | =TITLE role X::Comp 4 | 5 | =SUBTITLE Common role for compile-time errors 6 | 7 | role X::Comp is Exception { } 8 | 9 | Common role for compile-time errors. 10 | 11 | Note that since the backtrace of a compile time error generally shows 12 | routines from the compiler, not from user-space programs, the L 13 | returned from the L method is not very informative. Instead 14 | the exception carries its own C, C and C attributes 15 | and public accessors. 16 | 17 | If an error occurs while creating an object (like a class or routine) at 18 | compile time, generally the exception associated with it does not hold a 19 | reference to the object (for example a class would not be fully composed, and 20 | thus not usable). In those cases the name of the would-be-created object 21 | is included in the error message instead. 22 | 23 | =head1 Methods 24 | 25 | =head2 method filename 26 | 27 | The filename in which the compilation error occurred 28 | 29 | =head2 method line 30 | 31 | The line number in which the compilation error occurred. 32 | 33 | =head2 method column 34 | 35 | The column number of location where the compilation error occurred. 36 | (Rakudo does not implement that yet). 37 | 38 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/Composition/NotComposable.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Composition::NotComposable 4 | 5 | =SUBTITLE Compilation error due to composing an ineligible type 6 | 7 | class X::Composition::NotComposable is Exception { } 8 | 9 | Thrown when trying to compose a type into a target type, but the composer type 10 | cannot be used for composition (roles and enums are generally OK). 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | class A { } 16 | class B does A { } 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | ␤A is not composable, so B cannot compose it 23 | 24 | because C is reserved for role composition, and C is not a role, 25 | nor something that knows how to turn into a role. 26 | 27 | The fix is to either make C a role, or use inheritance 28 | (C) instead. 29 | 30 | =head1 Methods 31 | 32 | =head2 method target-name 33 | 34 | method target-name(--> Str:D) 35 | 36 | Returns the name of the type that should be composed, but failed. 37 | 38 | =head2 method composer 39 | 40 | method composer(--> Mu) 41 | 42 | Returns the type that should be composed into the target, but which isn't a 43 | role. 44 | 45 | =end pod 46 | -------------------------------------------------------------------------------- /doc/Type/X/Constructor/Positional.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Constructor::Positional 4 | 5 | =SUBTITLE Error due to passing positional arguments to a default constructor 6 | 7 | class X::Constructor::Positional is Exception { } 8 | 9 | Thrown from L when positional arguments are passed to it. 10 | 11 | For example 12 | 13 | class A { }; 14 | A.new(2, 3); 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::Constructor::Positional: Default constructor for 'A' only takes named arguments␤» 17 | 18 | =end pod 19 | -------------------------------------------------------------------------------- /doc/Type/X/Control.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE role X::Control 4 | 5 | =SUBTITLE Role for control exceptions 6 | 7 | role X::Control is Exception { } 8 | 9 | This role turns an exception into a 10 | L, such as 11 | C or C. It has got no code other than the definition. 12 | 13 | Since Rakudo 2019.03, Cing an object that mixes in this role 14 | C can raise a control exception which is caught by the L instead of L. 16 | This allows to define custom control exceptions. 17 | 18 | For example, the custom C control exception we define below: 19 | 20 | =begin code 21 | class CX::Vaya does X::Control { 22 | has $.message 23 | } 24 | 25 | sub ea { 26 | CONTROL { 27 | default { 28 | say "Controlled { .^name }: { .message }" 29 | } 30 | } 31 | CX::Vaya.new( message => "I messed up!" ).throw; 32 | 33 | } 34 | ea; 35 | # OUTPUT: «Controlled CX::Vaya: I messed up!␤» 36 | =end code 37 | 38 | =end pod 39 | -------------------------------------------------------------------------------- /doc/Type/X/ControlFlow.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::ControlFlow 4 | 5 | =SUBTITLE Error due to calling a loop control command in an ineligible scope 6 | 7 | class X::ControlFlow is Exception { } 8 | 9 | Thrown when a control flow construct (such as C or C) is called 10 | outside the dynamic scope of an enclosing construct that is supposed to catch 11 | them. 12 | 13 | For example 14 | 15 | last; 16 | CATCH { default { put .^name, ': ', .Str } }; 17 | # OUTPUT: «X::ControlFlow: last without loop construct␤» 18 | 19 | =head1 Methods 20 | 21 | =head2 method illegal 22 | 23 | method illegal returns Str:D 24 | 25 | Returns the name of the control flow command that was called. 26 | 27 | =head2 method enclosing 28 | 29 | method enclosing returns Str:D 30 | 31 | Returns the name of the missing enclosing construct. 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/X/ControlFlow/Return.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::ControlFlow::Return 4 | 5 | =SUBTITLE Error due to calling return outside a routine 6 | 7 | class X::ControlFlow::Return is X::ControlFlow { } 8 | 9 | Thrown when a C is called from outside a routine. 10 | 11 | return; 12 | CATCH { default { put .^name, ': ', .Str } }; 13 | # OUTPUT: «X::ControlFlow::Return: Attempt to return outside of any Routine␤» 14 | 15 | =end pod 16 | -------------------------------------------------------------------------------- /doc/Type/X/DateTime/TimezoneClash.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::DateTime::TimezoneClash 4 | 5 | =SUBTITLE Error due to using both time zone offset and :timezone 6 | 7 | =for code :skip-test 8 | class X::DateTime::TimezoneClash does X::Temporal is Exception { } 9 | 10 | This exception is thrown when code tries to create a C object 11 | specifying both a time zone offset and the named argument C<:timezone>. 12 | 13 | =for code 14 | say DateTime.new('2015-12-24T12:23:00+0200'); # works 15 | say DateTime.new('2015-12-24T12:23:00', timezone => 7200); # works 16 | say DateTime.new('2015-12-24T12:23:00+0200', timezone => 7200); # exception 17 | 18 | =head1 Methods 19 | 20 | =head2 sub message 21 | Defined as: 22 | 23 | method message() 24 | 25 | Returns 'DateTime.new(Str): :timezone argument not allowed with a timestamp 26 | offset' 27 | 28 | =end pod 29 | -------------------------------------------------------------------------------- /doc/Type/X/Declaration/Scope.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Declaration::Scope 4 | 5 | =SUBTITLE Compilation error due to a declaration with an ineligible scope 6 | 7 | =for code 8 | class X::Declaration::Scope does X::Comp { } 9 | 10 | Compile time error thrown when a declaration does not harmonize with the 11 | declared scope. 12 | 13 | For example 14 | 15 | =for code :skip-test 16 | has sub f() { } 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | Cannot use 'has' with sub declaration 23 | 24 | =head1 Methods 25 | 26 | =head2 method scope 27 | 28 | method scope(--> Str:D) 29 | 30 | Returns a string representation of the scope, usually the same keyword that is 31 | used for the declaration (C<"my">, C<"our">, C<"has">, ...); 32 | 33 | =head2 method declaration 34 | 35 | method declaration(--> Str:D) 36 | 37 | Describes the symbol that has been declared in a wrong scope. 38 | 39 | =end pod 40 | -------------------------------------------------------------------------------- /doc/Type/X/Declaration/Scope/Multi.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Declaration::Scope::Multi 4 | 5 | =SUBTITLE Compilation error due to declaring a multi with an ineligible scope 6 | 7 | class X::Declaration::Scope::Multi is X::Declaration::Scope { } 8 | 9 | Thrown when a multi is declared with an incompatible scope. 10 | 11 | For example C dies with 12 | 13 | =for code :lang 14 | ===SORRY!=== 15 | Cannot use 'our' with individual multi candidates. Please declare an our-scoped proto instead 16 | 17 | =end pod 18 | -------------------------------------------------------------------------------- /doc/Type/X/Does/TypeObject.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Does::TypeObject 4 | 5 | =SUBTITLE Error due to mixing into a type object 6 | 7 | class X::Does::TypeObject is Exception {} 8 | 9 | When you try to add one or more roles to a type object with C after it 10 | has been composed, an error of type C is thrown: 11 | 12 | =for code 13 | Mu does Numeric; # Cannot use 'does' operator with a type object. 14 | 15 | The correct way to apply roles to a type is at declaration time: 16 | 17 | =for code :skip-test 18 | class GrassmannNumber does Numeric { ... }; 19 | role AlgebraDebugger does IO { ... }; 20 | grammar IntegralParser does AlgebraParser { ... }; 21 | 22 | Roles may only be runtime-mixed into defined object instances: 23 | 24 | =for code :skip-test 25 | GrassmannNumber.new does AlgebraDebugger; 26 | 27 | (This restriction may be worked around by using 28 | L, or 29 | with dark Metamodel magics, but this will likely result in a 30 | significant performance penalty.) 31 | 32 | =head1 Methods 33 | 34 | =head2 method type 35 | 36 | method type(X::Does::TypeObject:D: --> Mu:U) 37 | 38 | Returns the type object into which the code tried to mix in a role. 39 | 40 | =end pod 41 | -------------------------------------------------------------------------------- /doc/Type/X/Dynamic/NotFound.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Dynamic::NotFound 4 | 5 | =SUBTITLE Runtime error thrown when a dynamic variable does not exist 6 | 7 | class X::Dynamic::NotFound is Exception {} 8 | 9 | This exception is raised when a dynamic variable that has not been declared 10 | is used. 11 | 12 | =for code :skip-test 13 | $*dynamic-not-found = 33; 14 | # OUTPUT: «Dynamic variable $*dynamic-not-found not found␤» 15 | 16 | =head1 Methods 17 | 18 | =head2 method name 19 | 20 | method name(--> Str:D) 21 | 22 | Returns the name of the variable that has not been found. 23 | 24 | =end pod 25 | -------------------------------------------------------------------------------- /doc/Type/X/Eval/NoSuchLang.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Eval::NoSuchLang 4 | 5 | =SUBTITLE Error due to specifying an unknown language for EVAL 6 | 7 | class X::Eval::NoSuchLang is Exception { } 8 | 9 | Error thrown when C specifies a language that the 10 | compiler does not know how to handle. 11 | 12 | For example 13 | 14 | EVAL 'boo', lang => "bar"; 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::Eval::NoSuchLang: No compiler available for language 'bar'␤» 17 | 18 | 19 | =head1 Methods 20 | 21 | =head2 method lang 22 | 23 | method lang() 24 | 25 | Returns the language that L did not know how to handle. 26 | 27 | =end pod 28 | -------------------------------------------------------------------------------- /doc/Type/X/Export/NameClash.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Export::NameClash 4 | 5 | =SUBTITLE Compilation error due to exporting the same symbol twice 6 | 7 | class X::Export::NameClash does X::Comp { } 8 | 9 | Compile time error thrown when a symbol is exported twice. 10 | 11 | For example 12 | 13 | =for code :skip-test 14 | sub f() is export { }; 15 | { 16 | sub f() is export { } 17 | } 18 | 19 | 20 | dies with 21 | 22 | =for code :lang 23 | ===SORRY!=== 24 | A symbol '&f' has already been exported 25 | 26 | =head1 Methods 27 | 28 | =head2 method symbol 29 | 30 | Returns the symbol that is exported twice. 31 | 32 | =end pod 33 | -------------------------------------------------------------------------------- /doc/Type/X/IO.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("exception") 2 | 3 | =TITLE role X::IO 4 | 5 | =SUBTITLE IO related error 6 | 7 | role X::IO does X::OS {} 8 | 9 | Common role for IO related errors. 10 | 11 | This role does not provide any additional methods. 12 | 13 | =end pod 14 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Chdir.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Chdir 4 | 5 | =SUBTITLE Error while trying to change the working directory 6 | 7 | =for code :skip-test 8 | class X::IO::Chdir does X::IO is Exception { } 9 | 10 | Error class when a L call failed. 11 | 12 | For example 13 | 14 | =for code 15 | chdir '/home/other' 16 | 17 | throws 18 | 19 | =for code :lang 20 | Failed to change the working directory to '/home/other': permission denied 21 | 22 | =head1 Methods 23 | 24 | =head2 method path 25 | 26 | Returns the path that was passed to the failed C call. 27 | 28 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/IO/Chmod.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Chmod 4 | 5 | =SUBTITLE Error while trying to change file permissions 6 | 7 | =for code :skip-test 8 | class X::IO::Chmod does X::IO is Exception { } 9 | 10 | Error class for failed C calls. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to set the mode of '/home/other' to '0o777': Permission denied 16 | 17 | =end pod 18 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Copy.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Copy 4 | 5 | =SUBTITLE Error while trying to copy a file 6 | 7 | =for code :skip-test 8 | class X::IO::Copy does X::IO is Exception { } 9 | 10 | Error class for failed file copy operations. A typical error message is 11 | 12 | =for code :lang 13 | Failed to copy 'source' to 'destination': permission denied 14 | 15 | =head1 Methods 16 | 17 | =head2 method from 18 | 19 | Returns the source of the failed copy operation 20 | 21 | =head2 method to 22 | 23 | Returns the destination of the failed copy operation 24 | 25 | =end pod 26 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Cwd.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Cwd 4 | 5 | =SUBTITLE Error while trying to determine the current working directory 6 | 7 | =for code :skip-test 8 | class X::IO::Cwd does X::IO is Exception { } 9 | 10 | Error class when the runtime fails to determine the current directory. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to get the working directory: permission denied 16 | 17 | =end pod 18 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Dir.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Dir 4 | 5 | =SUBTITLE Error while trying to get a directory's contents 6 | 7 | =for code :skip-test 8 | class X::IO::Dir does X::IO is Exception { } 9 | 10 | Error class that is thrown when a L call fails. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to get the directory contents of '/tmp/': No such file or directory 16 | 17 | =head1 Methods 18 | 19 | =head2 method path 20 | 21 | Returns the path that L failed to read. 22 | 23 | =end pod 24 | -------------------------------------------------------------------------------- /doc/Type/X/IO/DoesNotExist.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::DoesNotExist 4 | 5 | =SUBTITLE Error while doing file tests on a non existing path 6 | 7 | =for code :skip-test 8 | class X::IO::DoesNotExist does X::IO is Exception { } 9 | 10 | Thrown when doing file test operations on a non existing path. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to find 'euler-5.p6' while trying to do '.f' 16 | 17 | =head1 Methods 18 | 19 | =head2 method path 20 | 21 | Returns the path that was passed to the failed call. 22 | 23 | =head2 method trying 24 | 25 | Returns a string describing the failed operation. 26 | 27 | =end pod 28 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Link.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Link 4 | 5 | =SUBTITLE Error while trying to create a link 6 | 7 | =for code :skip-test 8 | class X::IO::Link does X::IO is Exception { } 9 | 10 | Error class for failed L operation. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to create link called 'my-link' on target 'does-not exist': Failed to link file 16 | 17 | =head1 Methods 18 | 19 | =head2 method target 20 | 21 | Returns the name of the link target, i.e. the existing file. 22 | 23 | =head2 method name 24 | 25 | Returns the name of the link that could not be created. 26 | 27 | =end pod 28 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Mkdir.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Mkdir 4 | 5 | =SUBTITLE Error while trying to create a directory 6 | 7 | =for code :skip-test 8 | class X::IO::Mkdir does X::IO is Exception { } 9 | 10 | Error class for failed L operations. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to create directory 'destination' with mode '0o755': File exists 16 | 17 | =head1 Methods 18 | 19 | =head2 method path 20 | 21 | Returns the path that the L operation failed to create. 22 | 23 | =head2 method mode 24 | 25 | Returns the permissions mask of the failed L operation as an L. 26 | 27 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/IO/Move.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Move 4 | 5 | =SUBTITLE Error while trying to move a file 6 | 7 | =for code :skip-test 8 | class X::IO::Move does X::IO is Exception { } 9 | 10 | Error class for a failed file move operation. A typical 11 | error message is 12 | 13 | =for code :lang 14 | Failed to move '/tmp/alpha.p6' to 'test.p6': :createonly specified and destination exists 15 | 16 | =head1 Methods 17 | 18 | =head2 method from 19 | 20 | Returns the source of the failed L operation 21 | 22 | =head2 method to 23 | 24 | Returns the destination of the failed L operation 25 | 26 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/IO/Rename.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Rename 4 | 5 | =SUBTITLE Error while trying to rename a file or directory 6 | 7 | =for code :skip-test 8 | class X::IO::Rename does X::IO is Exception { } 9 | 10 | Error class for failed file or directory rename operations. A typical 11 | error message is 12 | 13 | =for code :lang 14 | Failed to rename 'source' to 'destination': is a directory 15 | 16 | =head1 Methods 17 | 18 | =head2 method from 19 | 20 | Returns the source of the failed rename operation 21 | 22 | =head2 method to 23 | 24 | Returns the destination of the failed rename operation 25 | 26 | =end pod 27 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Rmdir.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Rmdir 4 | 5 | =SUBTITLE Error while trying to remove a directory 6 | 7 | =for code :skip-test 8 | my class X::IO::Rmdir does X::IO is Exception { } 9 | 10 | Error class for failed L operations. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to remove the directory 'lib': Directory not empty 16 | 17 | =head1 Methods 18 | 19 | =head2 method path 20 | 21 | Returns the path L failed to remove 22 | 23 | =end pod 24 | -------------------------------------------------------------------------------- /doc/Type/X/IO/Symlink.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Symlink 4 | 5 | =SUBTITLE Error while trying to create a symbolic link 6 | 7 | =for code :skip-test 8 | class X::IO::Symlink does X::IO is Exception { } 9 | 10 | Error class for failed L creation. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to create symlink called 'euler' on target '/home/myhome/euler-1.p6': Failed to symlink file: file already exist 16 | 17 | =head1 Methods 18 | 19 | =head2 method name 20 | 21 | Returns the path that L failed to create. 22 | 23 | =head2 method target 24 | 25 | Returns the path that L failed to create a link to. 26 | 27 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/IO/Unlink.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::IO::Unlink 4 | 5 | =SUBTITLE Error while trying to remove a file 6 | 7 | =for code :skip-test 8 | class X::IO::Unlink does X::IO is Exception { } 9 | 10 | Error class for failed L operation. 11 | 12 | A typical error message is 13 | 14 | =for code :lang 15 | Failed to remove the file 'secret': Permission defined 16 | 17 | =head1 Methods 18 | 19 | =head2 method path 20 | 21 | Returns the path that L failed to delete. 22 | 23 | =end pod 24 | -------------------------------------------------------------------------------- /doc/Type/X/Inheritance/Unsupported.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Inheritance::Unsupported 4 | 5 | =SUBTITLE Compilation error due to inheriting from an ineligible type 6 | 7 | class X::Inheritance::Unsupported does X::Comp { } 8 | 9 | Compile time error thrown when trying to inherit from a type that does 10 | not support inheritance (like a package or an enum). 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | enum A ; 16 | class B is A { }; 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | A does not support inheritance, so B cannot inherit from it 23 | 24 | =head1 Methods 25 | 26 | =head2 method child-typename 27 | 28 | The name of the type that tries to inherit. 29 | 30 | =head2 method parent 31 | 32 | The type object that the child tried to inherit from. 33 | 34 | =end pod 35 | -------------------------------------------------------------------------------- /doc/Type/X/Method/InvalidQualifier.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Method::InvalidQualifier 4 | 5 | =SUBTITLE Error due to calling a qualified method from an ineligible class 6 | 7 | class X::Method::InvalidQualifier is Exception { } 8 | 9 | Thrown when a method is call in the form C<$invocant.TheClass::method> if 10 | <$invocant> does not conform to C. 11 | 12 | For example 13 | 14 | 1.Str::split(/a/); 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::Method::InvalidQualifier: Cannot dispatch to method split on Str because it is not inherited or done by Int␤» 17 | 18 | =head1 Methods 19 | 20 | =head2 method method 21 | 22 | method method(--> Str:D) 23 | 24 | Returns the name of the (unqualified) method. 25 | 26 | =head2 method invocant 27 | 28 | Returns the invocant of the failed, qualified method call 29 | 30 | =head2 method qualifier-type 31 | 32 | Returns the type by which the method call was qualified. 33 | 34 | =end pod 35 | -------------------------------------------------------------------------------- /doc/Type/X/Method/NotFound.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Method::NotFound 4 | 5 | =SUBTITLE Error due to calling a method that isn't there 6 | 7 | class X::Method::NotFound is Exception {} 8 | 9 | Thrown when the user tries to call a method that isn't there. 10 | 11 | For example 12 | 13 | =for code 14 | 1.no-such 15 | 16 | throws 17 | 18 | =for code :lang 19 | No such method 'no-such' for invocant of type 'Int' 20 | 21 | =head1 Methods 22 | 23 | =head2 method method 24 | 25 | method method(--> Str:D) 26 | 27 | Returns the method name that was invoked. 28 | 29 | =head2 method typename 30 | 31 | method typename(--> Str:D) 32 | 33 | Returns the name of the invocant type. 34 | 35 | =head2 method private 36 | 37 | method private(--> Bool:D) 38 | 39 | Returns C for private methods, and C for public methods. 40 | 41 | =head2 method addendum 42 | 43 | method addendum(--> Str:D) 44 | 45 | Returns additional explanations or hints. 46 | 47 | I: C was introduced in Rakudo 2019.03. 48 | 49 | =end pod 50 | -------------------------------------------------------------------------------- /doc/Type/X/Method/Private/Permission.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Method::Private::Permission 4 | 5 | =SUBTITLE Compilation error due to calling a private method without permission 6 | 7 | class X::Method::Private::Permission does X::Comp { } 8 | 9 | Compile time error thrown when the code contains a call to a private method 10 | that isn't defined in the current class, and when no appropriate trusts 11 | relation is defined that permits the private method call. 12 | 13 | For example 14 | 15 | =for code :skip-test 16 | 1!Int::foo 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | Cannot call private method 'foo' on package Int because it does not trust GLOBAL 23 | 24 | =head1 Methods 25 | 26 | =head2 method method 27 | 28 | method method(--> Str:D) 29 | 30 | The name of the private method 31 | 32 | =head2 method source-package 33 | 34 | method source-package(--> Mu:D) 35 | 36 | Returns the type object that (supposedly) contains the private method. 37 | 38 | =head2 method calling-package 39 | 40 | method calling-package(--> Mu:D) 41 | 42 | Returns the package in which the calling code is, and which the source package 43 | does not trust. 44 | 45 | =end pod 46 | -------------------------------------------------------------------------------- /doc/Type/X/Method/Private/Unqualified.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Method::Private::Unqualified 4 | 5 | =SUBTITLE Compilation error due to an unqualified private method call 6 | 7 | class X::Method::Private::Unqualified does X::Comp { } 8 | 9 | Compile time error thrown when a private method call on anything but C 10 | is not fully qualified. 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | 1!priv 16 | 17 | dies with 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | Private method call to priv must be fully qualified with the package containing the method 22 | 23 | =head1 Methods 24 | 25 | =head2 method method 26 | 27 | method method(--> Str:D) 28 | 29 | Returns the name of the private method that triggered the error. 30 | 31 | =end pod 32 | -------------------------------------------------------------------------------- /doc/Type/X/Mixin/NotComposable.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Mixin::NotComposable 4 | 5 | =SUBTITLE Error due to using an ineligible type as a mixin 6 | 7 | class X::Mixin::NotComposable is Exception { } 8 | 9 | Thrown when a mixin with infix C or C is done with a composer that 10 | cannot be used for mixin. 11 | 12 | For example 13 | 14 | class A { }; 15 | 1 but A; 16 | CATCH { default { put .^name, ': ', .Str } }; 17 | # OUTPUT: «X::Mixin::NotComposable: Cannot mix in non-composable type A into object of type Int␤» 18 | 19 | The compile-time equivalent of this error is L 20 | 21 | =head1 Methods 22 | 23 | =head2 method target 24 | 25 | method target() 26 | 27 | Returns the target of the failed mixin operation. 28 | 29 | =head2 method rolish 30 | 31 | method rolish() 32 | 33 | Returns the thing that could not act as a role for mixing it in 34 | 35 | =end pod 36 | -------------------------------------------------------------------------------- /doc/Type/X/NoDispatcher.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::NoDispatcher 4 | 5 | =SUBTITLE Error due to calling a dispatch command in an ineligible scope 6 | 7 | class X::NoDispatcher is Exception { } 8 | 9 | When a redispatcher like C is called without being in the 10 | dynamic scope of a call where a redispatch is possible, an X::NoDispatcher is 11 | thrown. 12 | 13 | For example 14 | 15 | nextsame; # In the mainline 16 | CATCH { default { put .^name, ': ', .Str } }; 17 | # OUTPUT: «X::NoDispatcher: nextsame is not in the dynamic scope of a dispatcher␤» 18 | 19 | =head1 Methods 20 | 21 | =head2 method redispatcher 22 | 23 | method redispatcher(--> Str:D) 24 | 25 | Returns the name of the redispatcher function that did not succeed. 26 | 27 | =end pod 28 | -------------------------------------------------------------------------------- /doc/Type/X/Numeric/Real.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Numeric::Real 4 | 5 | =SUBTITLE Error while trying to coerce a number to a Real type 6 | 7 | class X::Numeric::Real is Exception { } 8 | 9 | Occurs when an attempt to coerce a C to a C, C, C or 10 | C fails (due to a number with a nonzero imaginary part, for instance). 11 | 12 | For example 13 | 14 | say (1+2i).Int; 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::Numeric::Real: Can not convert 1+2i to Int: imaginary part not zero␤» 17 | 18 | =head1 Methods 19 | 20 | =head2 method source 21 | 22 | method source(--> Numeric:D) 23 | 24 | Returns the number that failed to coerce to L. 25 | 26 | =head2 method target 27 | 28 | method target() 29 | 30 | Returns the type to which the coercion was attempted. 31 | 32 | =head2 method reason 33 | 34 | method reason(--> Str:D) 35 | 36 | Returns the reason that the conversion failed. 37 | 38 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/OS.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("role") :category("exception") 2 | 3 | =TITLE role X::OS 4 | 5 | =SUBTITLE Error reported by the operating system 6 | 7 | role X::OS { has $.os-error } 8 | 9 | Common role for all exceptions that are triggered by some error 10 | reported by the operating system (failed IO, system calls, 11 | fork, memory allocation). 12 | 13 | =head1 Methods 14 | 15 | =head2 method os-error 16 | 17 | method os-error(--> Str:D) 18 | 19 | Returns the error as reported by the operating system. 20 | 21 | =end pod 22 | -------------------------------------------------------------------------------- /doc/Type/X/Obsolete.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Obsolete 4 | 5 | =SUBTITLE Compilation error due to use of obsolete syntax 6 | 7 | class X::Obsolete does X::Comp { } 8 | 9 | Syntax error thrown when the user is attempting to use constructs from 10 | other languages. 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | m/abc/i 16 | 17 | dies with 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | Unsupported use of /i; in Raku please use :i 22 | 23 | =head1 Methods 24 | 25 | =head2 method old 26 | 27 | method old(--> Str:D) 28 | 29 | Returns a textual description of the obsolete syntax construct 30 | 31 | =head2 method replacement 32 | 33 | method replacement(--> Str:D) 34 | 35 | Describes what to use instead of the obsolete syntax. 36 | 37 | =head2 method when 38 | 39 | method when(--> Str:D) 40 | 41 | Returns a string describing the state of the language (usually 42 | C<" in Raku">). 43 | 44 | =end pod 45 | -------------------------------------------------------------------------------- /doc/Type/X/OutOfRange.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::OutOfRange 4 | 5 | =SUBTITLE Error due to indexing outside of an allowed range 6 | 7 | class X::OutOfRange is Exception { } 8 | 9 | General error when something (for example an array index) is out of an allowed 10 | range. 11 | 12 | For example 13 | 14 | say 42[2]; 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::OutOfRange: Index out of range. Is: 2, should be in 0..0␤» 17 | 18 | since scalars generally act as a one-element list. 19 | 20 | =head1 Methods 21 | 22 | =head2 method what 23 | 24 | method what(--> Str:D) 25 | 26 | Verbal description of the thing that was out of range (e.g. C<"array index">, 27 | C<"month">). 28 | 29 | =head2 method got 30 | 31 | method got() 32 | 33 | Returns the object that was considered out of range (often an integer) 34 | 35 | =head2 method range 36 | 37 | method range(--> Range:D) 38 | 39 | Returns a L object describing the permissible range for the object 40 | returned from C<.got>. 41 | 42 | =head2 method comment 43 | 44 | method comment(--> Str) 45 | 46 | Returns an additional comment that is included in the error message. 47 | 48 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/Package/Stubbed.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Package::Stubbed 4 | 5 | =SUBTITLE Compilation error due to a stubbed package that is never defined 6 | 7 | class X::Package::Stubbed does X::Comp { } 8 | 9 | Thrown at C time when there are packages stubbed but not later defined. 10 | 11 | For example 12 | 13 | =for code :skip-test 14 | class A { ... } # literal ... 15 | class B { ... } # literal ... 16 | 17 | dies with 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | The following packages were stubbed but not defined: 22 | A 23 | B 24 | 25 | =head1 Methods 26 | 27 | =head2 method packages 28 | 29 | method packages(--> Positional:D) 30 | 31 | Returns a list of packages that were stubbed but not defined. 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/X/Parameter/Default.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Parameter::Default 4 | 5 | =SUBTITLE Compilation error due to an unallowed default value in a signature 6 | 7 | class X::Parameter::Default does X::Comp { } 8 | 9 | Compile-time error thrown when a parameter in a signature has default value, 10 | but isn't allowed to have one. That is the case with slurpy parameters 11 | (because a slurpy always binds successfully, even to zero arguments) 12 | and with mandatory parameters. 13 | 14 | Example: 15 | 16 | =for code :skip-test 17 | sub f($x! = 3) { } 18 | 19 | dies with 20 | 21 | =for code :lang 22 | ===SORRY!=== 23 | Cannot put default on required parameter $x 24 | 25 | And 26 | 27 | =for code :skip-test 28 | sub f(*@ = 3) { } 29 | 30 | dies with 31 | 32 | =for code :lang 33 | ===SORRY!=== 34 | Cannot put default on anonymous slurpy parameter 35 | 36 | =head1 Methods 37 | 38 | =head2 method how 39 | 40 | Returns a string describing how the parameter is qualified that makes 41 | it disallow default values, for example C<"slurpy"> or C<"mandatory">. 42 | 43 | =head2 method parameter 44 | 45 | Returns the parameter name 46 | 47 | =end pod 48 | -------------------------------------------------------------------------------- /doc/Type/X/Parameter/MultipleTypeConstraints.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Parameter::MultipleTypeConstraints 4 | 5 | =SUBTITLE Compilation error due to a parameter with multiple type constraints 6 | 7 | class X::Parameter::MultipleTypeConstraints does X::Comp { } 8 | 9 | Compile time error thrown when a parameter has multiple type constraints. 10 | This is not allowed in Raku.0. 11 | 12 | Example: 13 | 14 | =for code :skip-test 15 | sub f(Cool Real $x) { } 16 | 17 | dies with 18 | 19 | =for code :lang 20 | Parameter $x may only have one prefix type constraint 21 | 22 | =head1 Methods 23 | 24 | =head2 method parameter 25 | 26 | Returns the name of the offensive parameter. 27 | 28 | =end pod 29 | -------------------------------------------------------------------------------- /doc/Type/X/Parameter/Placeholder.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Parameter::Placeholder 4 | 5 | =SUBTITLE Compilation error due to an unallowed placeholder in a signature 6 | 7 | class X::Parameter::Placeholder does X::Comp { } 8 | 9 | Thrown when a placeholder parameter is used inside a signature where 10 | a normal parameter is expected. The reason is often that a named parameter 11 | C<:$param> was misspelled as C<$:param>. 12 | 13 | For example 14 | 15 | =for code :skip-test 16 | sub f($:param) { } 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | In signature parameter, placeholder variables like $:param are illegal 23 | you probably meant a named parameter: ':$param' 24 | 25 | =head1 Methods 26 | 27 | =head2 method parameter 28 | 29 | The text of the offensive parameter declaration (C<$:param> in the example 30 | above). 31 | 32 | =head2 method right 33 | 34 | Suggestion on how to write the parameter declaration instead (C<:$param> in 35 | the example above). 36 | 37 | 38 | =end pod 39 | -------------------------------------------------------------------------------- /doc/Type/X/Parameter/Twigil.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Parameter::Twigil 4 | 5 | =SUBTITLE Compilation error due to an unallowed twigil in a signature 6 | 7 | class X::Parameter::Twigil does X::Comp { } 8 | 9 | Thrown when a parameter in a signature has a twigil that it may not have. 10 | Only C, C<.> and C<*> as twigils are allowed. 11 | 12 | Example: 13 | 14 | =for code :skip-test 15 | sub f($=foo) { } 16 | 17 | dies with 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | In signature parameter $=foo, it is illegal to use the = twigil 22 | 23 | =head1 Methods 24 | 25 | =head2 method parameter 26 | 27 | The name of the offensive parameter (C<$=foo> in the example above) 28 | 29 | =head2 method twigil 30 | 31 | The illegally used twigil. 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/X/Parameter/WrongOrder.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Parameter::WrongOrder 4 | 5 | =SUBTITLE Compilation error due to passing parameters in the wrong order 6 | 7 | class X::Parameter::WrongOrder does X::Comp { } 8 | 9 | Compile time error that is thrown when parameters in a signature in the wrong 10 | order (for example if an optional parameter comes before a mandatory 11 | parameter). 12 | 13 | For example 14 | 15 | =for code :skip-test 16 | sub f($a?, $b) { } 17 | 18 | dies with 19 | 20 | =for code :lang 21 | ===SORRY!=== 22 | Cannot put required parameter $b after optional parameters 23 | 24 | =head1 Methods 25 | 26 | =head2 method misplaced 27 | 28 | Returns the kind of misplaced parameter (for example C<"mandatory">, 29 | C<"positional">). 30 | 31 | =head2 method parameter 32 | 33 | Returns the name of the (first) misplaced parameter 34 | 35 | =head2 method after 36 | 37 | Returns a string describing other parameters after which the current parameter 38 | was illegally placed (for example C<"variadic">, C<"positional"> or 39 | C<"optional">). 40 | 41 | =end pod 42 | -------------------------------------------------------------------------------- /doc/Type/X/Phaser/Multiple.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Phaser::Multiple 4 | 5 | =SUBTITLE Compilation error due to multiple phasers of the same type 6 | 7 | class X::Phaser::Multiple does X::Comp { } 8 | 9 | Thrown when multiple phasers of the same type occur in a block, but only one 10 | is allowed (for example C or C). 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | CATCH { }; CATCH { } 16 | 17 | dies with 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | Only one CATCH block is allowed 22 | 23 | =head1 Methods 24 | 25 | =head2 method block 26 | 27 | Returns the name of the phaser that occurred more than once. 28 | 29 | =end pod 30 | -------------------------------------------------------------------------------- /doc/Type/X/Phaser/PrePost.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Phaser::PrePost 4 | 5 | =SUBTITLE Error due to a false return value of a PRE/POST phaser 6 | 7 | =for code 8 | class X::Phaser::PrePost is Exception { } 9 | 10 | Thrown when the condition inside a C
 or C phaser evaluate to a
11 | false value.
12 | 
13 | For example
14 | 
15 |     sub f($x) { PRE { $x ~~ Int } };
16 |     f "foo";
17 |     CATCH { default { put .^name, ': ', .Str } };
18 |     # OUTPUT: X::Phaser::PrePost: Precondition '{ $x ~~ Int }' failed«␤»
19 | 
20 | =head1 Methods
21 | 
22 | =head2 method phaser
23 | 
24 |     method phaser(--> Str:D)
25 | 
26 | Returns the name of the failed phaser, C<"PRE"> or C<"POST">.
27 | 
28 | =head2 method condition
29 | 
30 |     method condition(--> Str:D)
31 | 
32 | Returns the part of the source code that describes the phaser condition.
33 | 
34 | =end pod
35 | 


--------------------------------------------------------------------------------
/doc/Type/X/Placeholder/Block.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Placeholder::Block
 4 | 
 5 | =SUBTITLE Compilation error due to a placeholder in an ineligible block
 6 | 
 7 |     class X::Placeholder::Block does X::Comp {}
 8 | 
 9 | Thrown when a placeholder variable is used in a block that does not allow a
10 | signature.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | class A { $^foo }
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | Placeholder variable $^foo may not be used here because the surrounding block takes no signature
21 | 
22 | =head1 Methods
23 | 
24 | =head2 method placeholder
25 | 
26 | Returns the name of the (first) illegally used placeholder.
27 | 
28 | =end pod
29 | 


--------------------------------------------------------------------------------
/doc/Type/X/Placeholder/Mainline.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Placeholder::Mainline
 4 | 
 5 | =SUBTITLE Compilation error due to a placeholder in the mainline
 6 | 
 7 |     class X::Placeholder::Mainline is X::Placeholder::Block { }
 8 | 
 9 | Thrown when a placeholder variable is used in the mainline, i.e. outside of
10 | any explicit block.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | $^x;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Cannot use placeholder parameter $^x outside of a sub or block
22 | 
23 | Note that this error can also occur when you think something is a block,
24 | but it really is a L«postcircumfix:<{ }>|/routine/{ }», for example
25 | 
26 | =for code :skip-test
27 | my %h;
28 | say %h{ $^x };
29 | #     ^^^^^^^  not a block, so $^x is part of the mainline
30 | 
31 | =end pod
32 | 


--------------------------------------------------------------------------------
/doc/Type/X/Pod.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("role") :category("exception")
 2 | 
 3 | =TITLE role X::Pod
 4 | 
 5 | =SUBTITLE Pod related error
 6 | 
 7 |     role X::Pod { }
 8 | 
 9 | Common role for Pod related errors.
10 | 
11 | =end pod
12 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("role") :category("exception")
 2 | 
 3 | =TITLE role X::Proc::Async
 4 | 
 5 | =SUBTITLE Exception thrown by Proc::Async
 6 | 
 7 |     role X::Proc::Async is Exception { ... }
 8 | 
 9 | All exceptions thrown by L do this common role.
10 | 
11 | =head1 Methods
12 | 
13 | =head2 method proc
14 | 
15 |     method proc(X::Proc::Async:D --> Proc::Async)
16 | 
17 | Returns the object that threw the exception.
18 | 
19 | =end pod
20 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/AlreadyStarted.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::AlreadyStarted
 4 | 
 5 | =SUBTITLE Error due to calling start on an already started Proc::Async object
 6 | 
 7 |     class X::Proc::Async::AlreadyStarted is Exception {}
 8 | 
 9 | When you call C twice on the same L
10 | object, the second invocation will die with an
11 | C exception.
12 | 
13 |     my $proc = Proc::Async.new("echo");
14 |     $proc.start;
15 |     $proc.start;
16 |     CATCH { default { put .^name, ': ', .Str } };
17 |     # OUTPUT: «X::Proc::Async::AlreadyStarted: Process has already been started␤»
18 | 
19 | =end pod
20 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/BindOrUse.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::BindOrUse
 4 | 
 5 | =SUBTITLE Error due to trying to bind a handle that is also used
 6 | 
 7 | =for code :preamble
 8 |     class X::Proc::Async::BindOrUse does X::Proc::Async {}
 9 | 
10 | In general, it occurs when there's some mistake in the direction the stream
11 | flows, for instance:
12 | 
13 | =for code
14 | my $p = Proc::Async.new("ls", :w);
15 | my $h = "ls.out".IO.open(:w);
16 | $p.bind-stdin($h);
17 | # Fails with OUTPUT: «Cannot both bind stdin to a handle and also use :w␤»
18 | 
19 | In this case, C is already bound and cannot be used again; one of them
20 | should flow C<:out> and the other one C<:w> to work correctly.
21 | 
22 | =end pod
23 | 
24 | # vim: expandtab shiftwidth=4 ft=perl6
25 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/CharsOrBytes.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::CharsOrBytes
 4 | 
 5 | =SUBTITLE Error due to tapping the same Proc::Async stream for both text and binary reading
 6 | 
 7 |     class X::Proc::Async::CharsOrBytes is Exception {}
 8 | 
 9 | A L object allows subscription to the output or error stream
10 | either for bytes (L) or for text data (L), but
11 | not for both. If you do try both, it throws an exception of type
12 | C.
13 | 
14 |     my $proc = Proc::Async.new('echo');
15 |     $proc.stdout.tap(&print);
16 |     $proc.stdout(:bin).tap(&print);
17 |     CATCH { default { put .^name, ': ', .Str } };
18 |     # OUTPUT: «X::Proc::Async::CharsOrBytes: Can only tap one of chars or bytes supply for stdout␤»
19 | 
20 | =head1 Methods
21 | 
22 | =head2 method handle
23 | 
24 |     method handle(X::Proc::Async::CharsOrBytes:D: --> Str:D)
25 | 
26 | Returns the name of the handle that was accessed both for text and for binary
27 | data, C or C.
28 | 
29 | =end pod
30 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/MustBeStarted.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::MustBeStarted
 4 | 
 5 | =SUBTITLE Error due to interacting with a Proc::Async stream before spawning its process
 6 | 
 7 |     class X::Proc::Async::MustBeStarted is Exception {}
 8 | 
 9 | Several methods from L expect that the external program has been
10 | spawned (by calling C<.start> on it), including C, C, C and
11 | C. If one of those methods is called before C<.start> was called,
12 | they throw an exception of type C.
13 | 
14 |     Proc::Async.new('echo', :w).say(42);
15 |     CATCH { default { put .^name, ': ', .Str } };
16 |     # OUTPUT: «X::Proc::Async::MustBeStarted: Process must be started first before calling 'say'␤»
17 | 
18 | =head1 Methods
19 | 
20 | =head2 method method
21 | 
22 |     method method(X::Proc::Async::MustBeStarted:D --> Str:D)
23 | 
24 | Returns the name of the method that was illegally called before starting the
25 | external program.
26 | 
27 | =end pod
28 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/OpenForWriting.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::OpenForWriting
 4 | 
 5 | =SUBTITLE Error due to writing to a read-only Proc::Async object
 6 | 
 7 |     class X::Proc::Async::OpenForWriting is Exception {}
 8 | 
 9 | When a L object is opened only for reading from the external
10 | program (no C<:w> passed to open), and a write operation such as C,
11 | C and C is performed, an exception of type
12 | X is thrown:
13 | 
14 |     my $proc = Proc::Async.new("echo");
15 |     $proc.start;
16 |     $proc.say(42);
17 |     CATCH { default { put .^name, ': ', .Str } };
18 |     # OUTPUT: «X::Proc::Async::OpenForWriting: Process must be opened for writing with :w to call 'say'␤»
19 | 
20 | To fix that you can use writable commands with :w flag:
21 | 
22 |     my $prog = Proc::Async.new(:w, 'cat');
23 |     $prog.stdout.tap( -> $str {
24 |         print $str;
25 |     });
26 |     my $promise = $prog.start;
27 |     await $prog.say('foo');
28 |     $prog.close-stdin;
29 |     await $promise;
30 | 
31 | =head1 Methods
32 | 
33 | =head2 method method
34 | 
35 |     method method(X::Proc::Async::OpenForWriting:D:)
36 | 
37 | Returns the method name that was called and which caused the exception.
38 | 
39 | =end pod
40 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Async/TapBeforeSpawn.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Async::TapBeforeSpawn
 4 | 
 5 | =SUBTITLE Error due to tapping a Proc::Async stream after spawning its process
 6 | 
 7 |     class X::Proc::Async::TapBeforeSpawn is Exception {}
 8 | 
 9 | If the C or C methods of L are
10 | called after the program has been Ced, an exception of type
11 | L is thrown.
12 | 
13 |     my $proc = Proc::Async.new("echo", "foo");
14 |     $proc.start;
15 |     $proc.stdout.tap(&print);
16 |     CATCH { default { put .^name, ': ', .Str } };
17 |     # OUTPUT: «X::Proc::Async::TapBeforeSpawn: To avoid data races, you must tap stdout before running the process␤»
18 | 
19 | The right way is the reverse order
20 | 
21 |     my $proc = Proc::Async.new("echo", "foo");
22 |     $proc.stdout.tap(&print);
23 |     await $proc.start;
24 | 
25 | =head1 Methods
26 | 
27 | =head2 method handle
28 | 
29 |     method handle(X::Proc::Async::TapBeforeSpawn:D: --> Str:D)
30 | 
31 | Returns the name of the handle (C or C) that was accessed after the
32 | program started.
33 | 
34 | =end pod
35 | 


--------------------------------------------------------------------------------
/doc/Type/X/Proc/Unsuccessful.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Proc::Unsuccessful
 4 | 
 5 | =SUBTITLE Exception thrown if a Proc object is sunk after the process it ran exited unsuccessfully
 6 | 
 7 |     class X::Proc::Unsuccessful is Exception {}
 8 | 
 9 | =head1 Methods
10 | 
11 | =head2 method proc
12 | 
13 |     method proc(X::Proc::Unsuccessful:D --> Proc)
14 | 
15 | Returns the object that threw the exception.
16 | 
17 | =end pod
18 | 


--------------------------------------------------------------------------------
/doc/Type/X/Promise/CauseOnlyValidOnBroken.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Promise::CauseOnlyValidOnBroken
 4 | 
 5 | =SUBTITLE Error due to asking why an unbroken promise has been broken.
 6 | 
 7 |     class X::Promise::CauseOnlyValidOnBroken is Exception { }
 8 | 
 9 | This exception is thrown when code expects a Promise to be broken,
10 | and asks why it has been broken, but the Promise has in fact,
11 | not yet been broken.
12 | 
13 | =head1 Methods
14 | 
15 | =head2 method promise
16 | 
17 |     method promise()
18 | 
19 | Returns the Promise that was asked about.
20 | 
21 | =head2 method status
22 | 
23 |     method status()
24 | 
25 | Returns the status the Promise had at that time.
26 | 
27 | =end pod
28 | 


--------------------------------------------------------------------------------
/doc/Type/X/Promise/Vowed.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Promise::Vowed
 4 | 
 5 | =SUBTITLE Error due to directly trying to keep/break a vowed promise.
 6 | 
 7 |     class X::Promise::Vowed is Exception { }
 8 | 
 9 | This exception is thrown when code tries to keep/break an already vowed
10 | promise without going through the corresponding C object.
11 | 
12 | =head1 Methods
13 | 
14 | =head2 method promise
15 | 
16 |     method promise()
17 | 
18 | Returns the vowed Promise.
19 | 
20 | =end pod
21 | 


--------------------------------------------------------------------------------
/doc/Type/X/Role/Initialization.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Role::Initialization
 4 | 
 5 | =SUBTITLE Error due to passing an initialization value to an ineligible role
 6 | 
 7 |     class X::Role::Initialization is Exception { }
 8 | 
 9 | Thrown when the C syntax is used, but SomeRole does not have
10 | exactly one public attribute.
11 | 
12 | For example:
13 | 
14 | =begin code :skip-test
15 | role R { }; "D2" but R(2)
16 | CATCH { default { put .^name, ': ', .Str } }
17 | # OUTPUT: «X::Role::Initialization: Can only supply an initialization value for a role if it has a single public attribute, but this is not the case for 'R'␤»
18 | =end code
19 | 
20 | =head1 Methods
21 | 
22 | =head2 method role
23 | 
24 |     method role()
25 | 
26 | Returns the role that caused the error.
27 | 
28 | =end pod
29 | 


--------------------------------------------------------------------------------
/doc/Type/X/Scheduler/CueInNaNSeconds.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Scheduler::CueInNaNSeconds
 4 | 
 5 | =SUBTITLE Error caused by passing NaN to Scheduler.cue as :at, :in, or :every
 6 | 
 7 |     class X::Scheduler::CueInNaNSeconds is Exception { }
 8 | 
 9 | When calling C or C with
10 | C<:at>, C<:in>, or C<:every> as C, this exception gets thrown. For
11 | example, the following code:
12 | 
13 | =for code :skip-test
14 | my Cancellation $c = $*SCHEDULER.cue({
15 |     say 'This will never output :(';
16 | }, at => NaN);
17 | 
18 | Throws with:
19 | 
20 | =for code :lang
21 | Cannot pass NaN as a number of seconds to Scheduler.cue
22 | 
23 | This class only exists in releases 2019.05 and later.
24 | 
25 | =end pod
26 | 


--------------------------------------------------------------------------------
/doc/Type/X/Seq/Consumed.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Seq::Consumed
 4 | 
 5 | =SUBTITLE Error due to trying to reuse a consumed sequence
 6 | 
 7 |     class X::Seq::Consumed is Exception { }
 8 | 
 9 | This exception is thrown when a piece of code tries to reuse
10 | a C which has already been iterated.
11 | 
12 | =end pod
13 | 


--------------------------------------------------------------------------------
/doc/Type/X/Sequence/Deduction.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Sequence::Deduction
 4 | 
 5 | =SUBTITLE Error due to constructing a sequence from ineligible input
 6 | 
 7 |     class X::Sequence::Deduction is Exception { }
 8 | 
 9 | Exception type thrown when the C<...> sequence operator is being called
10 | without an explicit closure, and the sequence cannot be deduced.
11 | 
12 | =end pod
13 | 


--------------------------------------------------------------------------------
/doc/Type/X/Signature/NameClash.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Signature::NameClash
 4 | 
 5 | =SUBTITLE Compilation error due to two named parameters with the same name
 6 | 
 7 |     my class X::Signature::NameClash does X::Comp { }
 8 | 
 9 | Compile time error thrown when two named parameters have the same name,
10 | potentially through aliases.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | sub f(:$a, :a(:@b)) { }
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Name a used for more than one named parameter
22 | 
23 | =head1 Methods
24 | 
25 | =head2 method name
26 | 
27 |     method name(--> Str:D)
28 | 
29 | Returns the name that was used for more than one parameter.
30 | 
31 | =end pod
32 | 


--------------------------------------------------------------------------------
/doc/Type/X/Signature/Placeholder.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Signature::Placeholder
 4 | 
 5 | =SUBTITLE Compilation error due to placeholders in a block with a signature
 6 | 
 7 | =for code
 8 | class X::Signature::Placeholder does X::Comp { }
 9 | 
10 | Compile time error thrown when a block has both an explicit signature
11 | and placeholder parameters.
12 | 
13 | For example
14 | 
15 | =for code :skip-test
16 | sub f() { $^x }
17 | 
18 | dies with
19 | 
20 | =for code :lang
21 | ===SORRY!===
22 | Placeholder variable '$^x' cannot override existing signature
23 | 
24 | =head1 Methods
25 | 
26 | =head2 method placeholder
27 | 
28 |     method placeholder(--> Str:D)
29 | 
30 | Returns the name of a placeholder that was used in a block that already
31 | had a signature.
32 | 
33 | =end pod
34 | 


--------------------------------------------------------------------------------
/doc/Type/X/Str/Numeric.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Str::Numeric
 4 | 
 5 | =SUBTITLE Error while trying to coerce a string to a number
 6 | 
 7 |     class X::Str::Numeric is Exception { }
 8 | 
 9 | Error thrown (or wrapped in a C) when a conversion from string to
10 | a number fails.
11 | 
12 | For example
13 | 
14 |     say +"42 answers";
15 |     CATCH { default { put .^name, ': ', .Str } };
16 |     # OUTPUT: «X::Str::Numeric: Cannot convert string to number: trailing characters after number in '42⏏ answers' (indicated by ⏏)␤»
17 | 
18 | =head1 Methods
19 | 
20 | =head2 method source
21 | 
22 |     method source(--> Str:D)
23 | 
24 | Returns the string that was attempted to convert to a number
25 | 
26 | =head2 method pos
27 | 
28 |     method pos(--> Int:D)
29 | 
30 | Gives the position into the string where the parsing failed.
31 | 
32 | =head2 method reason
33 | 
34 |     method reason(--> Int:D)
35 | 
36 | Verbal description of the reason why the conversion failed.
37 | 
38 | =end pod
39 | 


--------------------------------------------------------------------------------
/doc/Type/X/StubCode.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::StubCode
 4 | 
 5 | =SUBTITLE Runtime error due to execution of stub code
 6 | 
 7 |     class X::StubCode is Exception { }
 8 | 
 9 | Thrown when a piece of stub code (created via C or C<...>) is executed.
10 | 
11 | =head1 Methods
12 | 
13 | =head2 method message
14 | 
15 | Returns the custom message provided to C, or a reasonable default if none
16 | was provided.
17 | 
18 | =end pod
19 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("role") :category("exception")
 2 | 
 3 | =TITLE role X::Syntax
 4 | 
 5 | =SUBTITLE Syntax error thrown by the compiler
 6 | 
 7 |     role X::Syntax does X::Comp { }
 8 | 
 9 | Common role for syntax errors thrown by the compiler.
10 | 
11 | =end pod
12 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Augment/WithoutMonkeyTyping.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Augment::WithoutMonkeyTyping
 4 | 
 5 | =SUBTITLE Compilation error due to augmenting a type without the C pragma
 6 | 
 7 |     class X::Syntax::Augment::WithoutMonkeyTyping does X::Syntax { }
 8 | 
 9 | Compile time error thrown when C is used without C.
10 | 
11 | Since C is considered a rather unsafe and impolite action, you have
12 | to pre-declare your intent with the C pragma.
13 | 
14 | If you don't do that, like here
15 | 
16 | =for code :skip-test
17 | augment class Int { };
18 | 
19 | you get the error
20 | 
21 | =for code :lang
22 | ===SORRY!===
23 | augment not allowed without 'use MONKEY-TYPING'
24 | 
25 | =end pod
26 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Comment/Embedded.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Comment::Embedded
 4 | 
 5 | =SUBTITLE Compilation error due to a malformed inline comment
 6 | 
 7 |     class X::Syntax::Comment::Embedded does X::Syntax { }
 8 | 
 9 | Syntax error thrown when C<#`> is encountered and it is not followed by
10 | an opening curly brace.
11 | 
12 | For example
13 | 
14 | =for code
15 | #`
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Opening bracket is required for #` comment
22 | 
23 | =end pod
24 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Confused.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Confused
 4 | 
 5 | =SUBTITLE Compilation error due to unrecognized syntax
 6 | 
 7 | =for code
 8 | class X::Syntax::Confused does X::Syntax { }
 9 | 
10 | The most general syntax error, if no more specific error message can be given.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | 1∞
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Confused
22 | 
23 | =end pod
24 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/InfixInTermPosition.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::InfixInTermPosition
 4 | 
 5 | =SUBTITLE Compilation error due to an infix in term position
 6 | 
 7 |     class X::Syntax::InfixInTermPosition does X::Syntax { }
 8 | 
 9 | Syntax error thrown when the parser expects a term, but finds an infix
10 | operator instead.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | 1, => 2;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Preceding context expects a term, but found infix => instead
22 | 
23 | =head1 Methods
24 | 
25 | =head2 method infix
26 | 
27 |     method infix(--> Str:D)
28 | 
29 | Returns the symbol of the infix that was found in term position.
30 | 
31 | =end pod
32 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Malformed.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Malformed
 4 | 
 5 | =SUBTITLE Compilation error due to a malformed construct (usually a declarator)
 6 | 
 7 |     class X::Syntax::Malformed does X::Syntax {}
 8 | 
 9 | The Raku compiler throws errors of type C when it
10 | knows what kind of declaration it is parsing, and encounters a syntax error,
11 | but can't give a more specific error message.
12 | 
13 | =for code :skip-test
14 | my Int a;   # throws an X::Syntax::Malformed
15 | 
16 | produces
17 | 
18 | =for code :lang
19 | ===SORRY!===
20 | Malformed my
21 | at -e:1
22 | ------> my Int ⏏a
23 | 
24 | 
25 | =head1 Methods
26 | 
27 | =head2 method what
28 | 
29 |     method what(X::Syntax::Malformed:D: --> Str)
30 | 
31 | Returns a description of the thing that was being parsed.
32 | 
33 | =end pod
34 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Missing.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Missing
 4 | 
 5 | =SUBTITLE Compilation error due to a missing piece of syntax
 6 | 
 7 |     class X::Syntax::Missing does X::Syntax { }
 8 | 
 9 | Syntax error thrown when the previous piece of syntax requires the
10 | existence of another piece of syntax, and that second piece is missing.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | for 1, 2, 3;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Missing block
22 | 
23 | because a C that is not a statement modifier must be followed by a block.
24 | 
25 | =head1 Methods
26 | 
27 | =head2 method what
28 | 
29 |     method what(--> Str:D)
30 | 
31 | Returns a string description of the missing syntax element.
32 | 
33 | =end pod
34 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/NegatedPair.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::NegatedPair
 4 | 
 5 | =SUBTITLE Compilation error due to passing an argument to a negated colonpair
 6 | 
 7 |     class X::Syntax::NegatedPair does X::Syntax { }
 8 | 
 9 | Thrown if a colonpair illegally has a value, for example C<:!a(1)>.
10 | This is an error because the C negation implies that the value is C.
11 | 
12 | A typical error message from this class is I.
14 | 
15 | =head1 Methods
16 | 
17 | =head2 method key
18 | 
19 | Returns the key of the pair that caused the error.
20 | 
21 | =end pod
22 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/NoSelf.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::NoSelf
 4 | 
 5 | =SUBTITLE Compilation error due to implicitly using a C that is not there
 6 | 
 7 |     class X::Syntax::NoSelf does X::Syntax { }
 8 | 
 9 | Compile time error thrown when C<$.foo> style calls are used where no invocant
10 | is available.
11 | 
12 | For example the code
13 | 
14 | =for code :skip-test
15 | $.meth;
16 | 
17 | in the program body throws the error
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Variable $.meth used where no 'self' is available
22 | 
23 | because C<$.meth> is short for C<$(self.meth)>, and there is no C
24 | available in mainline.
25 | 
26 | =head1 Methods
27 | 
28 | =head2 method variable
29 | 
30 | Returns the variable/method call that caused the error.
31 | 
32 | =end pod
33 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Number/RadixOutOfRange.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Number::RadixOutOfRange
 4 | 
 5 | =SUBTITLE Compilation error due to an unallowed radix in a number literal
 6 | 
 7 |     class X::Syntax::Number::RadixOutOfRange does X::Syntax { }
 8 | 
 9 | Syntax error that is thrown when the radix of a radix number is
10 | not allowed, like C<< :1<1> >> or C<< :42 >>.
11 | 
12 | =head1 Methods
13 | 
14 | =head2 method radix
15 | 
16 |     method radix(--> Int:D)
17 | 
18 | The offensive radix.
19 | 
20 | =end pod
21 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/P5.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::P5
 4 | 
 5 | =SUBTITLE Compilation error due to use of Perl 5-only syntax
 6 | 
 7 |     class X::Syntax::P5 does X::Syntax { }
 8 | 
 9 | Syntax error thrown when some piece of code is clearly Perl 5, not Raku.
10 | 
11 | For example
12 | 
13 | =for code :skip-test
14 | for my $a (1, 2) { };
15 | 
16 | dies with
17 | 
18 | =for code :lang
19 | ===SORRY!===
20 | This appears to be Perl 5 code
21 | 
22 | 
23 | =end pod
24 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Perl5Var.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Perl5Var
 4 | 
 5 | =SUBTITLE Compilation error due to use of Perl 5-only default variables
 6 | 
 7 |     class X::Syntax::Perl5Var does X::Syntax { }
 8 | 
 9 | Syntax error thrown when some piece of code tries to use one of the old Perl
10 | 5 variables (and it does not error for some other reason).
11 | 
12 | =for code :skip-test
13 | say $];
14 | 
15 | dies with
16 | 
17 | =for code :lang
18 | Unsupported use of $] variable; in Raku please use $*PERL.version or $*PERL.compiler.version
19 | 
20 | For every unsupported variable (which include most C<$^'letter'> constructs,
21 | as well as others like C<$">, the error message will mention that the
22 | variable is unsupported and the equivalent commands you could use.
23 | 
24 | 
25 | =end pod
26 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Regex/Adverb.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Regex::Adverb
 4 | 
 5 | =SUBTITLE Compilation error due to an unrecognized regex adverb
 6 | 
 7 |     class X::Syntax::Regex::Adverb does X::Syntax { }
 8 | 
 9 | Syntax error thrown when an unrecognized or illegal regex adverb is
10 | encountered.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | rx:g/a/
16 | 
17 | dies with
18 | 
19 | =begin code :lang
20 | ===SORRY!===
21 | Adverb g not allowed on rx
22 | =end code
23 | 
24 | because C<:g> belongs to a match operation, not a regex itself.
25 | 
26 | =head1 Methods
27 | 
28 | =head2 method adverb
29 | 
30 |     method adverb(--> Str:D)
31 | 
32 | Returns the illegally used adverb
33 | 
34 | =head2 method construct
35 | 
36 |     method construct(--> Str:D)
37 | 
38 | Returns the name of the construct that adverb was used on (C, C,
39 | C, C, C).
40 | 
41 | =end pod
42 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Regex/SolitaryQuantifier.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Regex::SolitaryQuantifier
 4 | 
 5 | =SUBTITLE Compilation error due to a regex quantifier without preceding atom
 6 | 
 7 |     class X::Syntax::Regex::SolitaryQuantifier does X::Syntax { }
 8 | 
 9 | Syntax error when a stand alone quantifier (without a preceding atom
10 | to quantify) is encountered in a regular expression.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | / * /;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Quantifier quantifies nothing
22 | 
23 | =end pod
24 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Reserved.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Reserved
 4 | 
 5 | =SUBTITLE Compilation error due to use of syntax reserved for future use
 6 | 
 7 |     class X::Syntax::Reserved does X::Syntax { }
 8 | 
 9 | Syntax error thrown when a syntax is used which is reserved for future
10 | expansion.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | my @a();
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | The () shape syntax in array declarations is reserved
22 | 
23 | =head1 Methods
24 | 
25 | =head2 method reserved
26 | 
27 |     method reserved(--> Str:D)
28 | 
29 | Returns a text description of the reserved syntax.
30 | 
31 | =head2 method instead
32 | 
33 |     method instead(--> Str)
34 | 
35 | Describes what to use instead of the reserved syntax (if anything).
36 | 
37 | =end pod
38 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Self/WithoutObject.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Self::WithoutObject
 4 | 
 5 | =SUBTITLE Compilation error due to invoking C in an ineligible scope
 6 | 
 7 |     class X::Syntax::Self::WithoutObject does X::Syntax { }
 8 | 
 9 | Syntax error thrown when C is referenced in a place where no
10 | invocant is available.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | self;
16 | 
17 | outside a class or role declaration dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | 'self' used where no object is available
22 | 
23 | =end pod
24 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Signature/InvocantMarker.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Signature::InvocantMarker
 4 | 
 5 | =SUBTITLE Compilation error due to a misplaced invocant marker in a signature
 6 | 
 7 |     class X::Syntax::Signature::InvocantMarker does X::Syntax { }
 8 | 
 9 | Syntax error when the invocant in a signature is anywhere else than after the
10 | first parameter.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | :($a, $b: $c);
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Can only use : as invocant marker in a signature after the first parameter
22 | 
23 | See also: L.
24 | 
25 | =end pod


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Term/MissingInitializer.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Term::MissingInitializer
 4 | 
 5 | =SUBTITLE Compilation error due to declaring a term without initialization
 6 | 
 7 |     class X::Syntax::Term::MissingInitializer does X::Syntax { }
 8 | 
 9 | Syntax error when a term (a backslash variable) is declared without
10 | initialization assignment.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | my \foo;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Term definition requires an initializer
22 | 
23 | Valid code would be
24 | 
25 | =for code
26 | my \foo = 42;
27 | 
28 | =end pod
29 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/UnlessElse.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::UnlessElse
 4 | 
 5 | =SUBTITLE Compilation error due to an C clause followed by C
 6 | 
 7 |     class X::Syntax::UnlessElse does X::Syntax { }
 8 | 
 9 | Syntax error thrown when an C clause is followed by an C clause.
10 | 
11 | For example
12 | 
13 | =for code :skip-test
14 | unless 1 { } else { };
15 | 
16 | dies with
17 | 
18 | =for code :lang
19 | ===SORRY!===
20 | "unless" does not take "else", please rewrite using "if"
21 | 
22 | =end pod
23 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Variable/Match.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Variable::Match
 4 | 
 5 | =SUBTITLE Compilation error due to declaring a match variable
 6 | 
 7 |     class X::Syntax::Variable::Match does X::Syntax { }
 8 | 
 9 | Syntax error thrown when a match variable like C<< $ >> was declared.
10 | 
11 | For example
12 | 
13 | =for code :skip-test
14 | my $;
15 | 
16 | dies with
17 | 
18 | =for code :lang
19 | ===SORRY!===
20 | Cannot declare a match variable
21 | 
22 | =end pod
23 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Variable/Numeric.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Variable::Numeric
 4 | 
 5 | =SUBTITLE Compilation error due to declaring a numeric symbol
 6 | 
 7 |     class X::Syntax::Variable::Numeric does X::Syntax { }
 8 | 
 9 | Syntax error thrown when trying to declare numeric symbols.
10 | 
11 | For example
12 | 
13 | =for code :skip-test
14 | my @101;
15 | 
16 | dies with
17 | 
18 | =for code :lang
19 | ===SORRY!===
20 | Cannot declare a numeric variable
21 | 
22 | =head1 Methods
23 | 
24 | =head2 method what
25 | 
26 |     method what returns Str:D
27 | 
28 | Returns a verbal description of the kind of symbol that was declared (variable,
29 | parameter, attribute).
30 | 
31 | =end pod
32 | 


--------------------------------------------------------------------------------
/doc/Type/X/Syntax/Variable/Twigil.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Syntax::Variable::Twigil
 4 | 
 5 | =SUBTITLE Compilation error due to an unallowed twigil in a declaration
 6 | 
 7 |     class X::Syntax::Variable::Twigil does X::Syntax { }
 8 | 
 9 | Syntax error thrown when a variable with a twigil is used in an incompatible
10 | declaration.
11 | 
12 | For example
13 | 
14 | =for code :skip-test
15 | my $!foo;
16 | 
17 | dies with
18 | 
19 | =for code :lang
20 | ===SORRY!===
21 | Cannot use ! twigil on my variable
22 | 
23 | =head1 Methods
24 | 
25 | =head2 method twigil
26 | 
27 |     method twigil(--> Str:D)
28 | 
29 | Returns the twigil that was illegally used
30 | 
31 | =head2 method scope
32 | 
33 |     method scope(--> Str:D)
34 | 
35 | Returns the scope that did not harmonize with the twigil.
36 | 
37 | =end pod
38 | 


--------------------------------------------------------------------------------
/doc/Type/X/Temporal.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("role") :category("exception")
 2 | 
 3 | =TITLE role X::Temporal
 4 | 
 5 | =SUBTITLE Error related to DateTime or Date
 6 | 
 7 |     role X::Temporal is Exception { }
 8 | 
 9 | A common exception type for all errors related to C or C.
10 | 
11 | =end pod
12 | 


--------------------------------------------------------------------------------
/doc/Type/X/Temporal/InvalidFormat.pod6:
--------------------------------------------------------------------------------
 1 | =begin pod :kind("Type") :subkind("class") :category("exception")
 2 | 
 3 | =TITLE class X::Temporal::InvalidFormat
 4 | 
 5 | =SUBTITLE Error due to using an invalid format when creating a DateTime or Date
 6 | 
 7 | =for code :skip-test
 8 | class X::Temporal::InvalidFormat does X::Temporal is Exception { }
 9 | 
10 | This exception is thrown when code tries to create a C or C object
11 | using an invalid format.
12 | 
13 | =begin code :ok-test
14 | my $dt = Date.new("12/25/2015"); 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::Temporal::InvalidFormat: Invalid Date string '12/25/2015'; use yyyy-mm-dd instead␤» 17 | =end code 18 | 19 | =head1 Methods 20 | 21 | =head2 method invalid-str 22 | 23 | Returns the invalid format string (C<12/25/2015> in the example above) 24 | 25 | =head2 method target 26 | 27 | Returns the target type (C in the example above) 28 | 29 | =head2 method format 30 | 31 | Returns valid format strings for the target type in question, (C in the example above) 32 | 33 | =end pod 34 | -------------------------------------------------------------------------------- /doc/Type/X/TypeCheck.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::TypeCheck 4 | 5 | =SUBTITLE Error due to a failed type check 6 | 7 | class X::TypeCheck is Exception { } 8 | 9 | Error class thrown when a type check fails. 10 | 11 | =head1 Methods 12 | 13 | =head2 method operation 14 | 15 | method operation(--> Str:D) 16 | 17 | Returns a string description of the operation that failed, for example 18 | C<"assignment">, C<"binding">, C<"return">. 19 | 20 | =head2 method got 21 | 22 | method got() 23 | 24 | Returns the object that failed to type check 25 | 26 | =head2 method expected 27 | 28 | method expected() 29 | 30 | Returns the type object against which the check failed. 31 | 32 | =end pod 33 | -------------------------------------------------------------------------------- /doc/Type/X/TypeCheck/Assignment.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::TypeCheck::Assignment 4 | 5 | =SUBTITLE Error due to a failed type check during assignment 6 | 7 | class X::TypeCheck::Assignment is X::TypeCheck { } 8 | 9 | Error class thrown when the type check of an assignment fails. 10 | 11 | For example, this will die 12 | 13 | my Int $x = "foo"; 14 | CATCH { default { put .^name, ': ', .Str } }; 15 | # OUTPUT: «X::TypeCheck::Assignment: Type check failed in assignment to $x; expected Int but got Str ("foo")␤» 16 | 17 | though compilers are allowed to detect obvious cases like this example 18 | and complain at compile time with a different error. 19 | 20 | =end pod 21 | -------------------------------------------------------------------------------- /doc/Type/X/TypeCheck/Binding.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::TypeCheck::Binding 4 | 5 | =SUBTITLE Error due to a failed type check during binding 6 | 7 | class X::TypeCheck::Binding is X::TypeCheck { } 8 | 9 | Thrown when the type check of a binding operation fails. 10 | 11 | For example: 12 | 13 | my Int $x := "foo"; 14 | CATCH { default { put .^name, ': ', .Str } }; 15 | # OUTPUT: «X::TypeCheck::Binding: Type check failed in binding; expected Int but got Str ("foo")␤» 16 | 17 | Note that the compiler is free to detect obvious errors at compile time, 18 | and complain with a different error at compile time. 19 | 20 | =end pod 21 | -------------------------------------------------------------------------------- /doc/Type/X/TypeCheck/Return.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::TypeCheck::Return 4 | 5 | =SUBTITLE Error due to a failed typecheck during C 6 | 7 | class X::TypeCheck::Return is X::TypeCheck { } 8 | 9 | Thrown when a return type check fails. 10 | 11 | For example 12 | 13 | sub f(--> Int) { "foo" } 14 | f(); 15 | CATCH { default { put .^name, ': ', .Str } }; 16 | # OUTPUT: «X::TypeCheck::Return: Type check failed for return value; expected Int but got Str ("foo")␤» 17 | 18 | =end pod 19 | -------------------------------------------------------------------------------- /doc/Type/X/TypeCheck/Splice.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::TypeCheck::Splice 4 | 5 | =SUBTITLE Compilation error due to a macro trying to splice a non-AST value 6 | 7 | class X::TypeCheck::Splice is X::TypeCheck does X::Comp { } 8 | 9 | Compile time error thrown when a L or an unquote/hole in a C 10 | quote does not return an L. 11 | 12 | For example 13 | 14 | =for code :skip-test 15 | use experimental :macros; 16 | macro quasi-ast { quasi { {{{'not AST'}}} };}; 17 | say quasi-ast; 18 | 19 | dies with 20 | 21 | =for code :lang 22 | ===SORRY!=== 23 | Type check failed in macro application; expected AST but got Str("not AST") 24 | 25 | This is because you are purposefully creating something that does not evaluate to an abstract syntax tree. To fix, instead write 26 | 27 | =for code 28 | use experimental :macros; 29 | macro an-ast { 30 | quasi { 'yes AST' } 31 | } 32 | say an-ast; # OUTPUT: «yes AST␤» 33 | 34 | =head1 Methods 35 | 36 | =head2 method action 37 | 38 | method action(--> Str:D) 39 | 40 | Returns a verbal description of the action that triggered the error, 41 | C<"macro application"> or C<"unquote evaluation">. 42 | 43 | =end pod -------------------------------------------------------------------------------- /doc/Type/X/Undeclared.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("exception") 2 | 3 | =TITLE class X::Undeclared 4 | 5 | =SUBTITLE Compilation error due to an undeclared symbol 6 | 7 | class X::Undeclared does X::Comp {} 8 | 9 | Thrown when the compiler encounters a symbol that has not been declared, 10 | but needs to be. 11 | 12 | Example 13 | 14 | =for code :skip-test 15 | $x; 16 | 17 | results in 18 | 19 | =for code :lang 20 | ===SORRY!=== 21 | Variable $x is not declared 22 | 23 | =head1 Methods 24 | 25 | =head2 method symbol 26 | 27 | Returns the name of the undeclared symbol 28 | 29 | =head2 method what 30 | 31 | Returns the kind of symbol that was not declared (for example variable, 32 | type, routine). 33 | 34 | Since The symbol wasn't declared, the compiler sometimes has to guess 35 | (or rather disambiguate) what kind of symbol it encounter that wasn't 36 | declared. For example if you write 37 | 38 | =for code :skip-test 39 | say a; 40 | 41 | Then the disambiguation defaults to reporting a missing subroutine, even 42 | though declaring a C would also make the error go away. 43 | 44 | =end pod 45 | -------------------------------------------------------------------------------- /doc/Type/utf8.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :kind("Type") :subkind("class") :category("composite") 2 | 3 | =TITLE class utf8 4 | 5 | =SUBTITLE Mutable uint8 buffer for utf8 binary data 6 | 7 | class utf8 does Blob[uint8] is repr('VMArray') {} 8 | 9 | A C is a subtype of Blob which is specifically uint8 data for holding UTF-8 10 | encoded text. 11 | 12 | my utf8 $b = "hello".encode; 13 | say $b[1].fmt("0x%X"); # OUTPUT: «0x65␤» 14 | 15 | =end pod 16 | 17 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 18 | -------------------------------------------------------------------------------- /highlights/highlight-file.coffee: -------------------------------------------------------------------------------- 1 | #!highlights/node_modules/coffee-script/bin/coffee 2 | 3 | Highlights = require 'highlights' 4 | fs = require 'fs' 5 | path = require 'path' 6 | highlighter = new Highlights() 7 | highlighter.requireGrammarsSync 8 | modulePath: require.resolve('./atom-language-perl6/package.json') 9 | 10 | file_to_hl = path.resolve(process.argv[2]) 11 | foo = -> 12 | fs.readFileSync file_to_hl, 'utf8' 13 | 14 | html = highlighter.highlightSync 15 | fileContents: foo() 16 | scopeName: 'source.perl6fe' 17 | 18 | console.log html 19 | -------------------------------------------------------------------------------- /highlights/highlight-filename-from-stdin.coffee: -------------------------------------------------------------------------------- 1 | #!highlights/node_modules/coffee-script/bin/coffee 2 | 3 | Highlights = require 'highlights' 4 | fs = require 'fs' 5 | path = require 'path' 6 | highlighter = new Highlights() 7 | highlighter.requireGrammarsSync 8 | modulePath: require.resolve('./atom-language-perl6/package.json') 9 | 10 | stdin = process.openStdin() 11 | stdin.setEncoding 'utf8' 12 | mystderr = process.stderr 13 | mystdout = process.stdout 14 | process_file = (given_path) -> 15 | full_path = path.resolve given_path 16 | i = 0 17 | e = true 18 | while e && !fs.existsSync(given_path) 19 | i++ 20 | if i > 100000 21 | console.error "Highlights runner: ERROR Giving up looking for the file. Cannot read file #{full_path}" 22 | e = false 23 | if i > 0 24 | console.error "Highlights runner: file #{full_path} does not exist. tried #{i} times." 25 | 26 | fs.readFile full_path, 'utf8', (read_err, file_str) -> 27 | if read_err 28 | console.error read_err 29 | else 30 | highlighter.highlight (fileContents: file_str, scopeName: 'source.perl6fe'), (hl_err, html) -> 31 | if hl_err 32 | console.error hl_err 33 | else 34 | obj = {} 35 | obj.file = full_path 36 | obj.html = html 37 | mystdout.write(JSON.stringify(obj) + '\n' ) 38 | 39 | 40 | stdin.on 'data', (input) -> 41 | process_file input.trim() 42 | -------------------------------------------------------------------------------- /highlights/highlight-folder.coffee: -------------------------------------------------------------------------------- 1 | Highlights = require 'highlights' 2 | fs = require 'fs' 3 | path = require 'path' 4 | highlighter = new Highlights() 5 | highlighter.requireGrammarsSync 6 | modulePath: require.resolve('./atom-language-perl6/package.json') 7 | 8 | TestFolder = path.resolve('TestFolder') 9 | files = fs.readdirSync(TestFolder) 10 | 11 | for file in files 12 | foo = -> 13 | fs.readFileSync path.resolve(TestFolder, file), 'utf8' 14 | html = highlighter.highlightSync 15 | fileContents: foo() 16 | scopeName: 'source.perl6fe' 17 | 18 | console.log html 19 | -------------------------------------------------------------------------------- /highlights/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "perl6-highlights", 3 | "version": "1.0.0", 4 | "description": "Perl 6 Highlighter using Highlights", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Samantha McVey", 10 | "license": "Artistic-2.0", 11 | "homepage": "https://docs.perl6.org", 12 | "repository": "https://github.com/perl6/doc.git", 13 | "dependencies": { 14 | "highlights": ">3.0", 15 | "less": "latest", 16 | "coffeescript": "latest", 17 | "node-sass": "latest" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_glass_45_C0E472_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_glass_45_C0E472_1x400.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_glass_75_c0e472_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_glass_75_c0e472_1x400.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_glass_75_f5e47b_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_glass_75_f5e47b_1x400.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_highlight-soft_75_f5e47b_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_highlight-soft_75_f5e47b_1x100.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_inset-hard_95_e47286_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_inset-hard_95_e47286_1x100.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-bg_inset-hard_95_f5e47b_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-bg_inset-hard_95_f5e47b_1x100.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-icons_000000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-icons_000000_256x240.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-icons_63a4ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-icons_63a4ff_256x240.png -------------------------------------------------------------------------------- /html/css/custom-theme/images/ui-icons_e13755_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/css/custom-theme/images/ui-icons_e13755_256x240.png -------------------------------------------------------------------------------- /html/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/favicon.ico -------------------------------------------------------------------------------- /html/images/External-link-04-bold-12x12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /html/images/camelia-404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/images/camelia-404.png -------------------------------------------------------------------------------- /html/images/camelia-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollwarm/Perl6doc/2c57cd11a6a95aa1a82b27735154528bf3572807/html/images/camelia-small.png -------------------------------------------------------------------------------- /html/images/pencil.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/Pod/Cache.pm6: -------------------------------------------------------------------------------- 1 | unit class Pod::Cache; 2 | 3 | # Given a filename, generate a cached, rendered version of the POD 4 | # in that file as text. 5 | 6 | method cache-file(Str $file --> Str) { 7 | my $outfile = '.pod-cache/' ~ $file; 8 | my $output-io = $outfile.IO; 9 | 10 | my $in-time = $file.IO.modified; 11 | my $out-time = $output-io.e ?? $output-io.modified !! 0; 12 | 13 | if $in-time > $out-time { 14 | mkdir $output-io.dirname; 15 | my $outfile = $output-io.open(:w); 16 | LEAVE $outfile.close; 17 | $outfile.lock; 18 | my $job = Proc::Async.new($*EXECUTABLE-NAME, '--doc', $file); 19 | $job.stdout.tap(-> $buf {$outfile.print: $buf}); 20 | 21 | await $job.start; 22 | } 23 | $outfile 24 | } 25 | -------------------------------------------------------------------------------- /lib/Pod/To/SectionFilter.pm6: -------------------------------------------------------------------------------- 1 | use Pod::To::Text; 2 | class Pod::To::SectionFilter { 3 | method render(@pod) { 4 | my $search_for = %*ENV // die 'env var missing'; 5 | my @blocks := @pod[0].contents; 6 | my $from; 7 | my $heading-level; 8 | for @blocks.kv -> $idx, $b { 9 | if $b ~~ Pod::Heading && $b.contents[0].contents[0] ~~ m:i:s/^ [method|sub|routine] $search_for $/ { 10 | $from = $idx; 11 | $heading-level = $b.level; 12 | } 13 | } 14 | return "No documentation found for method '$search_for'" 15 | unless defined $from; 16 | 17 | my $to = @blocks.end; 18 | for $from + 1 .. @blocks.end -> $i { 19 | if @blocks[$i] ~~ Pod::Heading && @blocks[$i].level <= $heading-level { 20 | $to = $i - 1; 21 | last; 22 | } 23 | } 24 | Pod::To::Text.render(@blocks[$from..$to]); 25 | } 26 | } 27 | 28 | # vim: expandtab shiftwidth=4 ft=perl6 29 | -------------------------------------------------------------------------------- /lib/Test-Files.pm6: -------------------------------------------------------------------------------- 1 | unit class Test-Files; 2 | 3 | method files() { 4 | my @files; 5 | 6 | if @*ARGS { 7 | @files = @*ARGS; 8 | } else { 9 | if %*ENV { 10 | @files = %*ENV.trim.split(' ').grep(*.IO.e); 11 | } else { 12 | @files = qx.lines; 13 | } 14 | } 15 | return @files; 16 | } 17 | 18 | method pods() { 19 | return $.files.grep({$_.ends-with: '.pod6'}) 20 | } 21 | 22 | method documents() { 23 | return $.files.grep({$_.ends-with: '.pod6' or $_.ends-with: '.md'}) 24 | } 25 | 26 | # vim: expandtab shiftwidth=4 ft=perl6 27 | -------------------------------------------------------------------------------- /p6doc.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /resources/i18n/zh/doc/Language/5to6-overview.zh.pod6: -------------------------------------------------------------------------------- 1 | =begin pod :tag 2 | 3 | =TITLE Perl 5到Perl 6指南-概述 4 | 5 | =SUBTITLE 我怎么能像Perl 5一样的开发? 6 | 7 | 这些文档不是给一个初学者教程,也不是Perl 6的宣传概述。而是给于有一定 8 | Perl 5 基础的老司机学习Perl6的技术指南。 9 | 10 | =head1 Perl 6初步 11 | L提供了Perl 6以下各方面的变化, 12 | 以供快速预览上手,包括语法、操作符、复合语句、正则、命令行参数以及其他值得提及的内容。 13 | 14 | =head1 语法差异 15 | 16 | L 提供了两者在语法上的差异: 17 | 主要格式的顺承、扩展的用法以及Perl 6中独有的语法。 18 | 19 | =head1 Perl 6操作符 20 | 21 | L<操作符部分|/language/5to6-perlop> 给我们列出了 22 | L在Perl 6 23 | 中的对应用法。 24 | 25 | =head1 Perl 6 函数 26 | 27 | L 描述了Perl 5中的所有函数及Perl 6对应用法和差异。 28 | 还提供了Perl 6 生态系统模块中Perl 5函数的对应函数,及各语法方面的差异(例如C), 29 | 以及Perl 6删掉的函数(比如 C)。 30 | 31 | =head1 Perl 6特殊变量 32 | 33 | L描述了Perl 6中队Perl 5特殊变量的支持。 34 | 35 | =end pod 36 | 37 | =begin comments 38 | 39 | ### 贡献指南: 40 | 41 | 标题应该包含Perl 5用户可能会搜索的文本,因为这些标题都会展现在生成的内容表顶级目录中。 42 | 对于不希望出现在内容表目录中的内容请使用POD =item,不要用=head3 或 =head4。 43 | 44 | 本文档没有描述新添加的语法,也没有说明可能的改进细节。例如,虽然C<0 + $string>也能显示, 45 | 但是我们应该使用C<+$string>(Blue Tiger 将会提供Perl现代化指南,提供一步一步的翻译程序 46 | 以及新成语的详细介绍和更好用的方法) 47 | 48 | 请提供应该长期支持的示例代码和其他详细细节的链接。 49 | 50 | 最后,用户实际的P5-> P6还未提及的问题,请添加到相关文档。即便是现在还无法回答问题, 51 | 也是值得收集的信息。 52 | 53 | =end comments 54 | 55 | # vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 56 | -------------------------------------------------------------------------------- /shippable.yml: -------------------------------------------------------------------------------- 1 | build: 2 | ci: 3 | - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61 4 | - echo "deb http://dl.bintray.com/nxadm/perl6-doc trusty main" | sudo tee -a /etc/apt/sources.list 5 | - apt-get update && apt-get install rakudo-pkg-for-doc libtap-formatter-junit-perl 6 | - PATH="/opt/rakudo-pkg-for-doc/bin:/opt/rakudo-pkg-for-doc/share/perl6/site/bin:$PATH" 7 | - zef install zef && zef update && zef install Perl6::TypeGraph 8 | - P6_DOC_TEST_VERBOSE=1 prove --timer --formatter=TAP::Formatter::JUnit -e perl6 t > shippable/testresults/doctests.xml 9 | 10 | -------------------------------------------------------------------------------- /t/00-meta.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use lib 'lib'; 5 | use Test; 6 | BEGIN plan :skip-all unless '.git'.IO.e; 7 | 8 | use Test::META; 9 | meta-ok; 10 | 11 | done-testing; 12 | -------------------------------------------------------------------------------- /t/01-load.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | BEGIN plan :skip-all unless '.git'.IO.e; 6 | 7 | plan 1; 8 | 9 | use-ok 'Pod::To::BigPage', 'load module Pod::To::BigPage'; 10 | -------------------------------------------------------------------------------- /t/02-pod-valid.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use lib 'lib'; 5 | use Test; 6 | BEGIN plan :skip-all unless '.git'.IO.e; 7 | 8 | use Test-Files; 9 | 10 | =begin overview 11 | 12 | Ensure any text that isn't a code example is valid C. 13 | 14 | =end overview 15 | 16 | my $max-jobs = %*ENV // 2; 17 | 18 | my @files-pod = Test-Files.pods; 19 | plan +@files-pod; 20 | 21 | my %data; 22 | test-files( @files-pod ); #Splits in two batches to avoid some errors. 23 | 24 | sub test-it($job) { 25 | my $file = $job.command[*-1]; 26 | ok !$job.exitcode && !%data{$file}, "$file has clean POD6" 27 | } 28 | 29 | sub test-files( @files ) { 30 | my @jobs; 31 | %data{@files} = 0 xx @files; 32 | for @files -> $file { 33 | my $p = Proc::Async.new($*EXECUTABLE-NAME, '--doc', $file); 34 | $p.stdout.tap: {;}; 35 | $p.stderr.tap: { 36 | %*ENV 37 | and diag qq:to/EOF/; 38 | There's been this error in file: $file 39 | $_ 40 | EOF 41 | %data{$file} = 1; 42 | } 43 | push @jobs: $p.start; 44 | if +@jobs > $max-jobs { 45 | test-it(await @jobs.shift); 46 | } 47 | } 48 | 49 | # In case there's something left to run. 50 | for @jobs.map: {await $_} -> $r { test-it($r) } 51 | } 52 | 53 | 54 | # vim: expandtab shiftwidth=4 ft=perl6 55 | -------------------------------------------------------------------------------- /t/03-pod6.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use lib 'lib'; 5 | use Test; 6 | BEGIN plan :skip-all unless '.git'.IO.e; 7 | 8 | use Test-Files; 9 | 10 | my @files = Test-Files.files; 11 | 12 | my @pod-only-files = @files.grep({$_.ends-with: '.pod'}) ; 13 | 14 | plan 1; 15 | is @pod-only-files.elems, 0, "no .pod files, only .pod6" ; 16 | 17 | 18 | # vim: expandtab shiftwidth=4 ft=perl6 19 | -------------------------------------------------------------------------------- /t/07-tabs.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use lib 'lib'; 5 | use Test; 6 | BEGIN plan :skip-all unless '.git'.IO.e; 7 | use Test-Files; 8 | 9 | my @files = Test-Files.files\ 10 | .grep({$_ ne 'LICENSE'|'Makefile'})\ 11 | .grep({! $_.contains('custom-theme')})\ 12 | .grep({! $_.contains('jquery')})\ 13 | .grep({! $_.ends-with('.png')})\ 14 | .grep({! $_.ends-with('.svg')})\ 15 | .grep({! $_.ends-with('.ico')}); 16 | 17 | plan +@files; 18 | 19 | for @files -> $file { 20 | my @lines; 21 | my $line-no = 1; 22 | for $file.IO.lines -> $line { 23 | @lines.push($line-no) if $line.contains("\t"); 24 | $line-no++; 25 | } 26 | if @lines { 27 | flunk "$file has tabs on lines: {@lines}"; 28 | } else { 29 | pass "$file has no tabs"; 30 | } 31 | } 32 | 33 | # vim: expandtab shiftwidth=4 ft=perl6 34 | -------------------------------------------------------------------------------- /template/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 28 | -------------------------------------------------------------------------------- /template/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /template/header.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 |
31 | EDITURL 32 | -------------------------------------------------------------------------------- /util/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rakudo-star:latest 2 | 3 | RUN buildDeps=' \ 4 | build-essential \ 5 | cpanminus \ 6 | ' \ 7 | runtimeDeps=' \ 8 | graphviz \ 9 | make \ 10 | ruby-sass \ 11 | ' \ 12 | testDeps=' \ 13 | aspell \ 14 | ' \ 15 | \ 16 | && set -x \ 17 | && apt-get update \ 18 | && apt-get --yes --no-install-recommends install $buildDeps $runtimeDeps $testDeps \ 19 | && rm -rf /var/lib/apt/lists/* \ 20 | \ 21 | && cpanm -vn Mojolicious \ 22 | && zef install zef && zef update && zef install Test::META Perl6::TypeGraph \ 23 | \ 24 | && n=/usr/local/bin/n \ 25 | && curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n > "$n" \ 26 | && chmod +x "$n" \ 27 | && n stable 28 | 29 | WORKDIR /perl6/doc 30 | EXPOSE 3000 31 | 32 | CMD make test && make html && ./app-start 33 | -------------------------------------------------------------------------------- /util/ignored-methods.txt: -------------------------------------------------------------------------------- 1 | # This file can have comments. 2 | Any: lazy-if 3 | Hash: categorize-list dynamic name BIND-KEY classify-list clone 4 | Dateish: IO earlier 5 | Str: codes simplematch BUILD Int Num word-by-word 6 | Array: dynamic STORE default name from-iterator reification-target 7 | -------------------------------------------------------------------------------- /util/issue-with-all-pod6.p6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | 5 | my @docs = qx/git ls-files | grep "\.pod6"/.lines; 6 | 7 | for @docs -> $d { 8 | my $repo-path = S[doc] = '/perl6/doc/blob/master/doc' with $d; 9 | my $web-path = S[doc] = 'https://docs.perl6.org' with $d; 10 | my $doc-name = $d.split("/")[*-1].split(".")[0]; 11 | given $web-path { 12 | when /Type/ { 13 | my @fragments = $web-path.split("/Type/"); 14 | $doc-name = @fragments[1].trans( ['/'] => ['::'] ).split(".")[0]; 15 | $web-path = @fragments[0] ~ "/type/" ~ $doc-name; 16 | } 17 | when "https://docs.perl6.org/HomePage.pod6" { 18 | $web-path = "https://docs.perl6.org/" 19 | } 20 | } 21 | 22 | $web-path .= trans( [ "Language", "Programs", ".pod6" ] => 23 | [ "language", "programs", "" ] ); 24 | say "* [ ] $doc-name [file]($repo-path), [generated]($web-path)"; 25 | } 26 | -------------------------------------------------------------------------------- /util/missing-types.p6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | use v6; 3 | use lib 'lib'; 4 | use Perl6::TypeGraph; 5 | 6 | my $t = Perl6::TypeGraph.new-from-file('type-graph.txt'); 7 | 8 | for $t.sorted -> $type { 9 | next if $type.name.index('Metamodel').defined || $type.name eq 'PROCESS'; 10 | my $actual = try ::($type.name); 11 | printf "%-40s not defined in this Perl\n", $type.name() 12 | if $actual === Any and $type.name ne "Any" | "Failure" | "Nil"; 13 | next unless $actual.^name eq $type.name; 14 | my $filename = 'doc/Type/' ~ $type.name.subst(:g, '::', '/') ~ '.pod6'; 15 | printf "%-40s not found in documentation\n", $type.name() unless $filename.IO.e; 16 | CATCH { default { } } 17 | } 18 | 19 | # vim: expandtab shiftwidth=4 ft=perl6 20 | -------------------------------------------------------------------------------- /util/new-type.p6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | 5 | sub MAIN($typename, :$kind='class') { 6 | my @path-chunks = $typename.split('::'); 7 | my $filename = @path-chunks.pop ~ '.pod6'; 8 | my $path = 'doc/Type'; 9 | for @path-chunks -> $c { 10 | $path ~= "/$c"; 11 | unless $path.IO.d { 12 | mkdir $path.IO.mkdir; 13 | } 14 | } 15 | 16 | $path ~= "/$filename"; 17 | 18 | spurt $path.IO, Q:q:to/HEADER/; 19 | =begin pod 20 | 21 | =TITLE $kind $typename 22 | 23 | =SUBTITLE ... 24 | 25 | $kind $typename is SuperClass { ... } 26 | 27 | Synopsis goes here 28 | 29 | HEADER 30 | spurt $path.IO, Q:c:to/BODY/; 31 | 32 | =head1 Methods 33 | 34 | =head2 method flurb 35 | 36 | method flurb({$typename}:D: *@args --> Str) 37 | 38 | method description here 39 | 40 | =end pod 41 | 42 | # vim: expandtab shiftwidth=4 ft=perl6 43 | BODY 44 | 45 | say "'$path' written"; 46 | say "(remember to 'git add $path')"; 47 | } 48 | 49 | # vim: expandtab shiftwidth=4 ft=perl6 50 | -------------------------------------------------------------------------------- /util/sync: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rsync -az --delete html/* html/.ht* doc.perl6.org@www.p6c.org:/var/www/doc.perl6.org 3 | -------------------------------------------------------------------------------- /util/sync-build-log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LOGDIR=$HOME/logs/build-log 3 | rsync -az --delete "$LOGDIR/" doc.perl6.org@www.p6c.org:/var/www/doc.perl6.org/build-log/ 4 | false 5 | -------------------------------------------------------------------------------- /util/test-links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cut -d '#' -f 1 links.txt | sort | uniq > links.tmp 4 | mv links.tmp links.txt 5 | wget -O- -i links.txt -B https://docs.perl6.org --method=HEAD 2>&1 | perl -ne '$_ =~ s/(.+)\n$/$1 /; print $_' | grep -v '200 OK' 6 | -------------------------------------------------------------------------------- /util/to-raku.p6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | use v6; 3 | use lib 'lib'; 4 | use Test-Files; 5 | 6 | 7 | my $degree = %*ENV // 2; 8 | 9 | 10 | multi sub replace-perl6(Str $file) { 11 | my $content = my $original-content = slurp $file; 12 | $content ~~ s:g/ 'Perl' [ \s+ | \x[00A0] ] '6' /Raku/; 13 | 14 | if $content ne $original-content { 15 | say "Corrected mentions of Perl 6 to Raku in '$file'."; 16 | $file.IO.spurt($content, :close); 17 | } 18 | } 19 | 20 | multi sub MAIN() { 21 | Test-Files.documents.race(:$degree).map(&replace-perl6); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /util/travis-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | 6 | case "${BUILDENV}" in 7 | docker) 8 | docker pull jjmerelo/perl6-doccer 9 | ;; 10 | whateverable) 11 | sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" 12 | sudo -E apt-get -yq update &>> ~/apt-get-update.log 13 | sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install graphviz g++-4.8 ruby-sass libc6 14 | wget https://whateverable.6lang.org/HEAD.tar.gz 15 | tar -xv --absolute-names -f HEAD.tar.gz 16 | HEAD_BUILD=$(echo /tmp/whateverable/rakudo-moar/*) 17 | export PATH="$PATH:$HEAD_BUILD/bin" 18 | ZEF_BUILD="$HEAD_BUILD/share/perl6/site/bin" 19 | git clone https://github.com/ugexe/zef.git && cd zef && perl6 -Ilib bin/zef install . && cd .. 20 | export PATH="$PATH:$ZEF_BUILD" 21 | zef --/tap-harness install IO::Socket::SSL # Needs to be installed in advance 22 | zef --/tap-harness --depsonly install . 23 | mkdir build 24 | ;; 25 | esac 26 | -------------------------------------------------------------------------------- /util/travis-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script for the "test" phase of Travis CI. 4 | 5 | set -x 6 | set -e 7 | 8 | case "${BUILDENV}" in 9 | docker) 10 | docker run -t -v $TRAVIS_BUILD_DIR:/test jjmerelo/perl6-doccer 11 | ;; 12 | whateverable) 13 | HEAD_BUILD=$(echo /tmp/whateverable/rakudo-moar/*) 14 | export PATH="$PATH:$HEAD_BUILD/bin" 15 | ZEF_BUILD="$HEAD_BUILD/share/perl6/site/bin" 16 | export PATH="$PATH:$ZEF_BUILD" 17 | P6_DOC_TEST_VERBOSE=1 make test 18 | make clean-build 19 | make gen-pod6-source 20 | perl6 htmlify.p6 --no-highlight --disambiguation=False 21 | ;; 22 | esac 23 | -------------------------------------------------------------------------------- /util/trigger-rebuild.txt: -------------------------------------------------------------------------------- 1 | Note: you can now trigger a rebuild on the build machine directly: 2 | 3 | sudo su -l doc.perl6.org 4 | touch ~/force-update 5 | 6 | But, if you want to, you can still trigger a rebuild by making commits 7 | with changes in this file. 8 | 9 | ################## 10 | -------------------------------------------------------------------------------- /util/update-and-sync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # DO NOT USE FOR LOCAL DEVELOPMENT 3 | # this script is used on hack.p6c.org as the 'doc.perl6.org' user to update 4 | # the website. It will remove any local changes you have made in your git checkout 5 | 6 | source ~/perl5/perlbrew/etc/bashrc 7 | source /home/rakudobrew/.rakudobrew-bash 8 | set -e 9 | set -x 10 | cd ~/doc 11 | git fetch 12 | before=$(git rev-parse HEAD) 13 | git checkout origin/master 14 | after=$(git rev-parse HEAD) 15 | if [ ! -f "$HOME/force-update" ] ; then 16 | if [ "$before" = "$after" ] ; then 17 | echo "nothing to do" 18 | exit 19 | fi 20 | fi 21 | 22 | rm "$HOME/force-update" || true; 23 | LOGDIR=$HOME/logs/build-log 24 | mkdir -p "$LOGDIR" 25 | DATE=$(date --iso-8601=minutes) 26 | LOGFILE="$LOGDIR/build-$DATE.log"; 27 | echo "Writing logs to $LOGFILE"; 28 | exec >$LOGFILE 2>&1 29 | 30 | echo "Building docs for $after with " `perl6 --version` 31 | echo 'Cleaning out old HTML files' 32 | # Clean everything that is not under source control 33 | git clean -xfd 34 | # find html/ -name '*.html' -delete # Old command 35 | 36 | # if the htmlify fails, sync the build log. 37 | # since sync-build-log returns false, not the whole thing is synced 38 | time make html || ./util/sync-build-log 39 | ./util/sync 40 | ./util/sync-build-log || true 41 | 42 | # vim: expandtab shiftwidth=4 43 | -------------------------------------------------------------------------------- /util/update-and-test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | =begin overview 4 | 5 | Not everyone runs the extended test suite; this gives developers the ability 6 | to test as they go; it updates the repository, runs xtest only on those 7 | files that have changed in that update, and leaves a local 'retest' script 8 | that can be rerun against those changes until xtest is clean. 9 | 10 | =end overview 11 | 12 | # Get the old and new commit IDs 13 | 14 | sub get-rev { 15 | run(, :out).out.slurp(:close).chomp; 16 | } 17 | 18 | my $old-rev = get-rev; 19 | run(); 20 | my $new-rev = get-rev; 21 | 22 | run(); 23 | 24 | if $old-rev eq $new-rev { 25 | say "No changes to test."; 26 | } else { 27 | my $revs = $old-rev ~ ".." ~ $new-rev; 28 | my $files = run('git', 'diff', '--name-only', $revs, :out).out.slurp(:close).chomp.split("\n").sort.join(" "); 29 | my $outfile = "./retest"; 30 | 31 | my $of = $outfile.IO.open(:w); 32 | 33 | $of.say: "#!/usr/bin/env perl6"; 34 | $of.say: "\%*ENV='$files';"; 35 | $of.say: "say \%*ENV;"; 36 | $of.say: "run().so"; 37 | 38 | $of.close; 39 | 40 | run('chmod', 'a+x', $outfile); 41 | 42 | run($outfile).so; 43 | say "Test same set of files again with $outfile"; 44 | } 45 | -------------------------------------------------------------------------------- /util/xt-recent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Test only the most recent commits for xtest issues 4 | # (much faster than running the whole suite) 5 | 6 | 7 | TEST_FILES=$(git llog | egrep '^M.*\.(pod6|md)$' | head -40 | sort -u | awk '{print $2}' | tr '\n' ' ' | sed 's/ $//') make xtest 8 | -------------------------------------------------------------------------------- /writing-docs/CREATING-NEW-DOCS.md: -------------------------------------------------------------------------------- 1 | ### A new (or existing) pod6 document currently must adhere to the following conventions: 2 | 3 | 1. it must be valid Raku pod 4 | 2. the first non-comment or non-empty line must be: 5 | 6 | =begin pod # optionally followed by :key %config pairs 7 | 8 | 3. the second non-comment or non-empty line must be: 9 | 10 | =TITLE ...text... 11 | 12 | 4. an optional (but usually desired) subtitle must be the third non-comment or non-empty line: 13 | 14 | =SUBTITLE ...text... 15 | 16 | 5. the last non-comment or non-empty line must be: 17 | 18 | =end pod 19 | 20 | ### Valid example: 21 | 22 | ``` 23 | # this is a valid, non-pod comment 24 | =begin pod :my-link # another comment 25 | =TITLE Working with Raku pod 26 | =SUBTITLE Alice in Wonderland 27 | # ... more valid pod and text 28 | =comment a pod comment # a valid comment 29 | =end pod 30 | # vi or emacs info 31 | ``` 32 | 33 | ### Invalid example: 34 | 35 | ``` 36 | =comment a pod comment # this is not a valid comment in this position 37 | =begin pod :my-link # another comment 38 | =TITLE Working with Raku pod 39 | =SUBTITLE Alice in Wonderland 40 | # ... more valid pod and text 41 | =end pod 42 | # vi or emacs info 43 | ``` 44 | -------------------------------------------------------------------------------- /xt/braces.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | 6 | use lib 'lib'; 7 | use Pod::Cache; 8 | use Test-Files; 9 | 10 | =begin overview 11 | 12 | Enforce B and B or B B. 13 | 14 | =end overview 15 | 16 | my @files = Test-Files.documents; 17 | 18 | plan +@files; 19 | 20 | sub test-it(Str $output, Str $file) { 21 | my $ok = True; 22 | 23 | my $msg; 24 | 25 | my $line = $output.subst(/\s+/, ' ', :g) # canonicalize whitespace 26 | .subst('Opening bracket is required for', ''); # rakudo/rakudo#2672 27 | 28 | if $line ~~ /:i ' ' 'braces' >> / { 29 | $msg ~= "Found 'braces' without 'curly'. "; 30 | $ok = False; 31 | } 32 | 33 | if $line ~~ /:i ' ' ('bracket' [s|ed]?) >> / { 34 | $msg ~= "Found '{~$0}' without 'square' or 'angle'."; 35 | $ok = False; 36 | } 37 | 38 | ok $ok, $file ~ ($msg ?? ": $msg" !! ""); 39 | } 40 | 41 | for @files -> $file { 42 | if $file.ends-with('.pod6') { 43 | test-it(Pod::Cache.cache-file($file).IO.slurp, $file); 44 | } else { 45 | test-it($file.IO.slurp, $file); 46 | } 47 | } 48 | 49 | # vim: expandtab shiftwidth=4 ft=perl6 50 | -------------------------------------------------------------------------------- /xt/double-dots.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | 6 | use lib 'lib'; 7 | use Pod::Cache; 8 | use Test-Files; 9 | 10 | =begin overview 11 | 12 | Avoid using C<..> - usually a typo for C<.> or C<...> 13 | 14 | =end overview 15 | 16 | my @files = Test-Files.documents; 17 | 18 | plan +@files; 19 | 20 | sub test-it(Str $output, Str $file) { 21 | my $ok = True; 22 | 23 | for $output.lines -> $line { 24 | if $line ~~ / '..' ( | $) / { 25 | diag "Failure on line `$line`"; 26 | $ok = False; 27 | } 28 | } 29 | my $error = $file; 30 | ok $ok, "$error: file contains .."; 31 | } 32 | 33 | for @files -> $file { 34 | if $file.ends-with('.pod6') { 35 | test-it(Pod::Cache.cache-file($file).IO.slurp, $file) 36 | } else { 37 | test-it($file.IO.slurp, $file); 38 | } 39 | } 40 | 41 | # vim: expandtab shiftwidth=4 ft=perl6 42 | -------------------------------------------------------------------------------- /xt/perl-nbsp.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | use lib 'lib'; 6 | use Test-Files; 7 | 8 | =begin overview 9 | 10 | Ensure any text that mentions Perl uses a no-break space after it. 11 | 12 | =end overview 13 | 14 | my @files = Test-Files.documents; 15 | 16 | plan +@files; 17 | 18 | for @files.sort -> $file { 19 | my $ok = True; 20 | my $row = 0; 21 | my @bad; 22 | my $content = $file.IO.slurp.lines.join("\n"); 23 | for $content ~~ m:g/ 'Perl' $=(\s+) \d / -> $match { 24 | my $spaces = ~$match; 25 | if $spaces.chars != 1 || $spaces.uniname ne "NO-BREAK SPACE" { 26 | $ok = False; 27 | @bad.push: $row; 28 | } 29 | } 30 | my $error = $file; 31 | if !$ok { 32 | $error ~= " (line{@bad>1 ?? "s" !! ""} {@bad.join: ', '})"; 33 | } 34 | ok $ok, "$error: Perl followed by a version should have a single non-breaking space." ; 35 | } 36 | 37 | # vim: expandtab shiftwidth=4 ft=perl6 38 | -------------------------------------------------------------------------------- /xt/return-type.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | use lib 'lib'; 6 | use Test-Files; 7 | 8 | # Every .pod6 file in the Type directory. 9 | my @files = Test-Files.pods.grep(* ~~ /Type | Language/); 10 | 11 | plan +@files; 12 | 13 | for @files -> $file { 14 | my @lines; 15 | my Int $line-no = 1; 16 | for $file.IO.lines -> $line { 17 | if so $line ~~ /(multi|method|sub) .+? ')' \s+? 'returns' \s+? (|':')+? $/ { 18 | @lines.push($line-no); 19 | } 20 | $line-no++; 21 | } 22 | if @lines { 23 | flunk "$file uses 'returns' at lines: {@lines}; should be -->"; 24 | } else { 25 | pass "$file return types are ok"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /xt/trailing-whitespace.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | use Test; 5 | use lib 'lib'; 6 | use Test-Files; 7 | 8 | =begin overview 9 | 10 | Make sure that no line includes trailing whitespace. 11 | 12 | =end overview 13 | 14 | my @files = Test-Files.files\ 15 | .grep({$_ ne 'LICENSE'})\ 16 | .grep({! $_.contains: 'custom-theme'})\ 17 | .grep({! $_.contains: 'util/trigger-rebuild.txt'})\ 18 | .grep({! $_.contains: 'jquery'})\ 19 | .grep({! $_.ends-with: '.png'})\ 20 | .grep({! $_.ends-with: '.svg'})\ 21 | .grep({! $_.ends-with: '.ico'}); 22 | 23 | plan +@files; 24 | 25 | for @files -> $file { 26 | my $ok = True; 27 | my $row = 0; 28 | for $file.IO.lines -> $line { 29 | ++$row; 30 | if $line ~~ / \s $/ { 31 | $ok = False; last; 32 | } 33 | } 34 | my $error = $file; 35 | $error ~= " (line $row)" if !$ok; 36 | ok $ok, "$error: Must not have any trailing whitespace."; 37 | } 38 | 39 | # vim: expandtab shiftwidth=4 ft=perl6 40 | -------------------------------------------------------------------------------- /xt/type-graph.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl6 2 | 3 | use v6; 4 | 5 | use Test; 6 | use Perl6::TypeGraph; 7 | use Telemetry; 8 | 9 | my $t = Perl6::TypeGraph.new-from-file('type-graph.txt'); 10 | 11 | for $t.sorted -> $type { 12 | next if $type.name.index('Metamodel').defined || $type.name eq 'PROCESS'; 13 | next if $type.packagetype eq 'role'|'module'; 14 | # these types does not support mro => whitelisted 15 | next if $type.name eq any(); 16 | try { 17 | my $got = ~$type.mro; 18 | my $expected = ~::($type).^mro.map: *.^name; 19 | is $got, $expected, $type; 20 | CATCH { 21 | default { 22 | flunk "Trouble with $type: $_"; 23 | } 24 | } 25 | } 26 | } 27 | 28 | done-testing; 29 | 30 | # vim: expandtab shiftwidth=4 ft=perl6 31 | --------------------------------------------------------------------------------