-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checklist for 6.d #2632
Comments
I'm going to be starting with deprecations. Please work on the rest, and say here what you will do. |
OK; I'll go now for the first section, version-controlled changes. |
Can someone clarify what:
means? Does it mean in supply or react scope? |
@JJ yes, previously this was allowed:
Notice how
|
Can anyone tell me what this:
means? Or what it means that before they were magical? |
See this issue |
In the case of Cs
I have checked the example, which does not use return-rw, and seems to work without a problem. return-rw works in the same way. Doesn't must imply it's going to fail otherwise? |
I think that the spec above wasn't finally done due to this |
I don't think this is true:
There's no way to get the default value. So even if that's the case, I don't think it should go to the documentation. |
I'm currently working at Math section :D! I'll update here my progress. |
This does not make a lot of sense. made is defined in NQPMatchRole and redefined in Match; there's no override in Grammar. I'll try and find out what it means. |
It's likely it's this commit. In that case, it's |
Including "generated" ones like XX, mentioned in #2632
IO::Handle.eof value changes accordingly when .seeking past end and back documented in IO:: Handle eof Type coerces can be used in signature return type constraints documented in Signature Coercion_type |
And adds ::?MODULE, which apparently contains the same. This refers to #2632, but I haven't found much about that "extended spec", other than it's in roast.
I couldn't find what "Defined |
The
item refers to this PR. Trying to understand what "restricted syntax" means and what it really implies. |
The problem
Many things have changed in the 6.d version, of which we have at least one release. Here is the list. However, coverage is patchy. Deprecation notices take different form, some new Types and methods are there, some are not...
Refer to this issue with
refs #2632
and check the item when you work on it either via change in the documentation of after seeing that no changes need to be done to it. In that case, please explain via comment or however why is that the case.Version-Controlled Changes
&await
no longer blocks a thread while waitingwhenever
not in lexical scope ofreact
throws$*ARGFILES
insidesub MAIN
is always fed by$*IN
$()
,@()
, and%()
are no longer magical:D
/:U
type constraints default to type object ofthe constrained type (e.g. so you could use
.new
with them)start
blocks in sink context attach exception handler- [ ] [6.d] Routines must usereturn-rw
to return aProxy
, even ifroutine is marked as
is raw
oris rw
num
types default to0e0
instead ofNaN
sym
(e.g.:sym<foo>
)is reserved, in anticipation of possible future use.
Deprecations
These methods are deprecated in 6.d language and will be removed in 6.e.
Implementations may choose to emit deprecation warnings or to offer these
methods for a longer period than 6.e release.
'-'
(single hyphen) as a special path to&open
to mean thespecial handles (use
IO::Special
objects instead)IO::Handle.slurp-rest
(use.slurp
instead)Any.flatmap
(use combination of.flat
and.map
methods instead)Cool.path
(use.IO
instead)Pair.freeze
(usePair.new
with decontainerized arguments instead)Str.subst-mutate
(useStr.subst
with.=
method call assign metaop instead)Rational.norm
(Rational
types are required to be normalized on creation now)IO::Path.child
(use.add
instead)&undefine
(assignEmpty
/Nil
directly, instead):count
argument on&lines
/Str.lines
routines(use
.elems
call on returnedSeq
instead)&is_approx
in Test.pm6 (use the very similar behaviour of&is-approx
instead)New Behaviors
sub MAIN
via new definable&RUN-MAIN
,&ARGS-TO-CAPTURE
, and&GENERATE-USAGE
subsQuantHash
es/Map
in%
variables andList
in@
variablescan be declared with
is
trait (e.g.my %h is Set
)<ww>
regex rule: match within word onlynext
/last
in a loop that collects its last statement valuesreturn
Empty
for the iterations they run on.perl
can be called on consumedSeq
s, multi-dimensional arrays,Date
, andCallFrame
.gist
can be called onAttribute
USAGE
messageis hidden-from-USAGE
trait to hidesub MAIN
candidates fromauto-generated
USAGE
messageParameter.perl
includes introspectable defaults%*ENV
values are allomorphic$;
,$,
,$.
,$\
,$(
,$)
,$<
,$>
,$/
,$\
,$[
,$-
,$+
, and$@
throws
X::Syntax::Perl5Var
Hash.keyof
returns aStr(Any)
coercer type object:42foo
colonpair shortcutStrDistance
stringifies to its.after
stringEnumeration.enums
returns aMap
.Range
on various integer types returns the range of values they supportmin
/max
routines also work onHash
esSignature
literals can contain string/numeric literals aswell as the invocant marker
List.invert
maps via a requiredPair
binding, resulting inpotential type check failures
:exists
can be used with multi-dimensional associative subscripts.first
Proc
can work withIO::Pipe
s from otherProc
smy SomeType @array
and
my @array of SomeType
a
Mixy
toSetty
/Baggy
:nth
adverb onm//
accepts aJunction
as argumentCX::Warn
andCX::Done
can be caught insideCONTROL
phasernext
can be used inwhenever
require
'd symbols no longer transitively exposed{…}
, similar to how it works with[…]
END
time get automatically closedSeq
, the cached list is used when&infix:<eqv>
,.Slip
,.join
,.List
,.list
,.eager
,.Array
and.is-lazy
are calledIO::Handle.encoding
takesNil
to indicate switch to binary modeis default
trait works with attributesis rw
trait are considered narrower in multi dispatchthan those without it
.gist
ofArray
,Blob
, andMap
gets trimmed to 100 elementsfor
statement modifiershyper for
,race for
, andlazy for
for
loop automatically serializesRaceSeq
/HyperSeq
; use newfor
statement modifiers
hyper for
/race for
to avoid&infix:<does>
can be used with non-composable instances on RHSDateTime
objectsPod
preserves the type of whitespace@
-,%
- and&
-sigilledconstant
sMath
Rational
s are always reduced on creation and remainimmutable throughout their life
-Inf
,Inf
, andNaN
can be round-tripped through aRational
typeby being represented as values
<-1/0>
,<1/0>
, and<0/0
>respectively. Zero-denominator
Rational
s are normalized toone of those three values
.Int
on ±Inf
andNaN
throwsNum
operators and math functionsNum
(-0e0
) gets correctlyhandled by all routines and syntactical constructs
Num
type is required to be roundtrippableto the original
Num
Complex
exponentiation involving zeros.expmod
are validSets, Bags, Mixes (aka QuantHashes) and set operators
perform the desired functionality without them
most liberal form (Set -> Bag -> Mix)
(<+)
,≼
,(>+)
,≽
) hasbeen removed
so
(<=)
,⊆
,(>=)
,⊇
do the right thing.classify-list
method is available onBaggy
types.categorize-list
method is available onBaggy
types.invert
method is available on coreQuantHash
types.antipairs
method can be used onQuantHash
typesQuantHash
types have.new-from-pairs
and methods to convert oneQuantHash
type to another (e.g..Bag
method onSet
type).hash
onQuantHash
types does stringify keysNew Parameters and Arguments
Date.new
accepts a:&formatter
.first
can take:kv
unique
and.repeated
can take:&as
and:&with
&plan
in Test.pm6 can take:skip-all
&run
/&shell
can take:merge
¬e
can be called with no argumentsopen
accepts:$out-buffer
IO::Path.resolve
can take:completely
IO::Path.parent
can take anInt
indicating parent levelProc::Async.new
slurps positional argumentsSignature.ACCEPTS
accepts non-Signature
/Capture
arguments&EVAL
can take aBlob
Promise.keep
/.break
can be called with no arguments.sum
on native arrays can take:wrap
is required
trait can now take an argument indicating reasonIO::Socket::Async.listen
can bind to port0
to ask OS for a free port.encode
can take:translate-nl
New Routines and Operators
atomicint
Unicode operators and ASCII alternatives that guaranteethread-safe, atomic operation:
&infix:<⚛=>
/&atomic-assign
,&prefix:<⚛>
/&atomic-fetch
,&prefix:<++⚛>
/&atomic-inc-fetch
,&postfix:<⚛++>
/&atomic-fetch-inc
,&prefix:<--⚛>
/&atomic-dec-fetch
,&postfix:<⚛-->
/&atomic-fetch-dec
,&infix:<⚛-=>
/&infix:<⚛−=>
/&atomic-fetch-sub
,and
&infix:<⚛+=>
/&atomic-fetch-add
&cas
: atomic compare and swap≤
,≥
, and≠
operators are Unicode operatoralternatives to
<=
,>=
, and!=
respectively&infix:<unicmp>
/&infix:<coll>
: alternative behavior of&infix:<cmp>
TR///
: non-mutating version oftr///
submethod TWEAK
: similar toBUILD
, except it's compatible with attribute defaults&duckmap
: apply&callable
on each element that behaves in such a waythat
&callable
can be applied&deepmap
: apply&callable
on each element, descending intoIterable
s&take-rw
: like&take
but with a writable container&indir
: execute code in a given$*CWD
&spurt
: seeIO::Path.spurt
&prompt
: prompt user for inputuniprops
: multi-character version ofuniprop
symlink
: create a file symlinklink
: create a file hardlink.hyper
/.race
: process a list of values in parallelSeq.from-loop
: generate aSeq
from aCallable
Str.uniparse
: parse one or more Unicode character names intothe actual characters
Str.parse-base
: inverse ofInt.base
operationIO::Path
provides.ACCEPTS
,.SPEC
,.CWD
,.Numeric
,.add
,.extension
,.mode
and numerious file tests,.parts
,.sibling
, and.spurt
IO::Handle
provides.READ
,.WRITE
,.EOF
,.DESTROY
,.readchars
,.flush
,.lock
,.unlock
,.out-buffer
,.tell
,.say
,.slurp
,.seek
,.printf
,.print-nl
, and.watch
IO::Pipe
provides.proc
Iterator
provides.skip-one
,.skip-at-least
,and
.skip-at-least-pull-one
Mu.emit
: method form of&emit
&fails-like
in Test.pm6 module: allows testing for Failures&bail-out
in Test.pm6 module: exit out of failing test suite&is-approx
in Test.pm6 module: test a number is approximately like anotherBuf
has.allocate
,.reallocate
,.append
,.push
,.pop
,.splice
,.subbuf-rw
,.prepend
, and.unshift
methodsRange
supports.rand
Backtrace
has methods.map
,.flat
,.concise
, and.summary
.classify-list
method is available onHash
types.categorize-list
method is available onHash
typesCode.of
: returns the return type constraintCode.line
/.file
: returns the line/file of definitionProc::Async
provides.Supply
,.ready
,.pid
,.bind-stdin
,.bind-stdout
, and.bind-stderr
Proc.command
/Proc::Async.command
: the command we're executingProc
provides.signal
,.pid
, and.encoding
Complex
provides.cis
,.reals
,.ceiling
,.floor
,.round
,.truncate
, and.abs
methods and can be compared with<=>
(aslong as the imaginary part is negligible)
DateTime
provides.offset-in-hours
,.hh-mm-ss
, and.Date
DateTime
can be compared with otherDateTime
objects using<=>
operatorDate
provides.DateTime
method&infix:<+>
/&infix:<->
can be called withDuration
,DateTime
,and
Real
typesEnumeration
provides.Int
,.pred
,.succ
,.kv
, and.pair
.Date
can be called on anInstant
Junction.new
callList
type has.to
and.from
methodsMap
type providesInt
method, returning the number of pairsAny.skip
: skip values in a listAny.batch
: more basic cousin of.rotor
Mu.iterator
: produce anIterator
for values in a listIO::Spec::*
types provide.tmpdir
,.extension
, and.path
Pair
provides.ACCEPTS
,.Pair
, and.invert
.Capture
method is well-defined for all core types.ACCEPTS
on allomorphsFailure.self
explodes unhandledFailure
sThread.is-initial-thread
: are we running in the initial thread?Match
provides.Int
and.actions
IO::Socket::Async
provides.socket-port
and.peer-port
Promise
provides alternative constructors.kept
and.broken
WhateverCode
provides.assuming
WhateverCode
andBlock
provide.cando
.:<…>
syntax for calling prefix operators as postfixes$*KERNEL
provides.hostname
Nil
has.FALLBACK
special method defined to returnNil
New Types
atomicint
: a nativeint
sized to be usable with new atomic operatorsLock::Async
: a non-blocking mechanism for mutual exclusionEncoding::Registry
: manage available encodingsEncoding::Encoder
: encoder for a specific encodingEncoding::Decoder
: decoder for a specific encodingIO::CatHandle
: use multiple read-onlyIO::Handle
s as if they were onestr
arraysSupplier::Preserving
: cached liveSupply
factorySemaphore
: control access to shared resources by multiple threadsIO::Special
: a path to special I/O device (e.g.STDOUT
)Exceptions::JSON
an implementation of custom exceptions handler(can be used with
PERL6_EXCEPTIONS_HANDLER
env var)SeekType
enum: values for use inIO::Handle.seek
New Variables
$*USAGE
: available insideMAIN
subs and contains the auto-generatedUSAGE message
%*SUB-MAIN-OPTS
: settings for behaviour ofsub MAIN
%*SUB-MAIN-OPTS<named-anywhere>
allow named arguments to beplaced at any position on the command line
$*COLLATION
: configures the four Unicode collation levels$*INIT-INSTANT
: anInstant
representing program startup time$*HOME
: user's home directory, if one exists&*chdir
: aCallable
containing a variant ofIO::Path.chdir
thatalso sets process's current directory
PERL6_TEST_DIE_ON_FAIL
environmental variable: stop testsuite on first failure
PERL6_EXCEPTIONS_HANDLER
environmental variable: specify customexceptions handler class
Clarifications of Edge Case/Coercion Behaviour
UInt
smartmatchesTrue
withInt
type objectsink
statement prefix explodesFailure
spermutations
/combinations
on 1- and 0-itemlists and negative and non-Int arguments
&val
,Str.Numeric
, and otherStr
numeric conversion methodsfail
when trying to convert UnicodeNo
charactergroup or synthetic numerics
:42foo
colonpair shortcutEnumeration
can now be used as a array shape specifierStr
containing nothing but whitespace returns0
nowsamemark
with empty pattern argument simply returns the invocant.polymod
can be used withlazy
but finite lists of divisors.[*-0]
index is defined.rotor
that are larger than the sublist throwInt
arguments to.rotor
get coerced toInt
.lines
is defined when reading/proc
files++
/--
on stringsmap
inside sunkfor
is treated as sunkfor
loop sinks value of last statement's method call.Int
onBool
objects returns anInt
objectsplice
can be used to extend an arrayclassify
works withJunction
s.pairup
on a type object returns an emptySeq
.pairup
always returns aSeq
Date
/DateTime
constructors⸨
/⸩
pair can now be used as matching characters in quoting constructs.flat
on anArray
type object simply returns that type objectclassify
onHash
es throwsJunction
s can be used to specify multiple keys toHash
esCallable
given to.classify-list
is now guaranteed to beexecuted only once per each item
:delete
on associative lookup onHash
type object returnsNil
&is-deeply
from Test.pm6 automatically.cache
sSeq
s givenas arguments and uses the returned
List
s for testingComplex.new()
gives<0+0i>
Int.new
is now guarantied to construct a newInt
(rather than, say,re-use one from a constants cache)
&infix:<=:=>
and&infix:<eqv>
are definedNil
type now throws if directly or indirectly calling.BIND-POS
,.BIND-KEY
,.ASSIGN-POS
,.ASSIGN-KEY
,.STORE
,.push
,.append
,.unshift
,.prepend
Nil.ord
returns an emptySeq
Nil.chrs
returns a"\0"
Num.new
coercers argument toNum
infix:<Z>()
returns an emptySeq
.comb
always returns aSeq
&infix:<+>
with one item simply returns that item()[0]
returnsNil
Seq
Range
objectsSet
converted to aMix
/Bag
no longer hasBool
weightsgcd
is defined when one or more operands are0
Junction
s autothread indefined
routinesum
can handle lists withJunctions
in themGrammar.parse
lets topregex
backtrackU+2212 MINUS SIGN [Sm] (−)
is now supported by more constructs,such as
Str.Numeric
and&val
&infix:<~>
works withBlob
sNumeric
literals are supported as value literals in signature\b
and\B
in regexes throwX::Obsolete
True
andFalse
as value literals in signatures warn.sort
andIO::Spec::Unix.path
is alwaysSeq
.AT-POS
onRange
objects returnsNil
Pair.AT-KEY
for non-existent key returnsNil
Cool
types provide.Rat
/.FatRat
coercersIO::Path
filetests do not cache results of earlier test executionsSeq
eqvList
asFalse
based on type mismatch alone- [ ] On arrays,See Writable kv, pair, values are not tested roast#614 and On arrays, Hashes, and QuantHashes, values from .kv, .values, and .pairs sequences are writable #3519Hash
es, andQuantHash
es, values from.kv
,.values
, and.pairs
sequences are writable&infix:<∘>
/&infix:<o>
keep LHF's.of
and RHS's.arity
and.count
:in(…)
)IO::Handle.open
IO::Path.Str
does not include the value of.CWD
attributeIO::Path
type rejects paths with thenul
byte ("\0"
) in themIO::Pipe
's.path
/.IO
return anIO::Path
type objectIO::Path
's.copy
/.move
fail
if destination and original are the samedir
-createdIO::Path
s' absoluteness is controlled by the invocantCallable
handling,.defined
calling,and chaining of
&infix:<andthen>
,&infix:<orelse>
,and
&infix:<notandthen>
operatorsSeq
s does not cache themList.Capture
stringifies keys of any containedPair
objects&fail
with handledFailure
argument marks it as unhandleduse lib
acceptsIO::Path
objects^
,^^
,$
, and$$
are valid in lookaroundsGrammar.made
supports type objects.isa
supportssubset
type objects:delete
can be used on lazy arrays&infix:<eqv>
can work with certain cases of lazy arguments::(…)
) is restricted regex syntax andrequires
use MONKEY-SEE-NO-EVAL
clearance.Slip
and.List
on arrays with holesPromise.in
/.at
andSupply.interval
work with zero and negative valuesSupply.interval
minimum value is0.001
; lower values aretreated as
0.001
and emit warnings # mentioned at https://docs.perl6.org/type/Supply#method_interval PR Mention 6.d standard value of minimal interval #2649Supply
provides.Seq
,.list
, and.zip
WhateverCode
propagatesuse fatal
say
,note
,put
,print
, andprintf
routines autothreadJunction
sIO::Handle.eof
value changes accordingly when.seek
ing past end and back.succ
,.pred
, and.Bool
on allomorphs.Bridge
on coreNumeric
s- [ ] Defined.Numeric
/.Real
on type objects of coreNumeric
sRational.Bool
with respect to zero-denominator rationalssay
/note
guaranteed to call.gist
on subclasses ofStr
Junction.Str
returns aJunction
Junction.gist
/.perl
return aStr
Map
/Hash
's.list
/.cache
return aList
.round
's return typeEnumeration:D
not does.ACCEPT
anEnumeration:U
See Bad propspec: Enum's :D accepts Enum's :U rakudo/rakudo#2073Miscellaneous
IO::ArgFiles
type is just an empty subclass ofIO::CatHandle
(i.e. using
my Foo constant @int
) throwsX::ParametricConstant
exceptionPod
=defn
(definition list) directive is availablePod
provides:numbered
config key.^ver
,.^auth
, and.^name
metamethods are available onmodule
and are absent on a
package
, by design’…’
,“…”
,「…」
, and variants) are supported inqww<…>
&infix:< >
supports lookup of autogeneratedCallables
(e.g.&infix:<XX>
)anon
sub no longer produces redeclaration warnings::?MODULE
/$?MODULE
variablesub MAIN
can accept anEnumeration
type constraint andwhere
clause on arguments
start
blocks and thunks get fresh$/
and$!
R
meta operator used with list-associative operators is defined&infix:<x>
/&infix:<x>
throw with-Inf
/NaN
repeat argumentsput
andput for
throw, requiring use of parentheses$.
method call syntax shorthand works with meta-methodsThe text was updated successfully, but these errors were encountered: