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 #2632and 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
&awaitno longer blocks a thread while waitingwhenevernot in lexical scope ofreactthrows$*ARGFILESinsidesub MAINis always fed by$*IN$(),@(), and%()are no longer magical:D/:Utype constraints default to type object ofthe constrained type (e.g. so you could use
.newwith them)startblocks in sink context attach exception handler- [ ] [6.d] Routines must usereturn-rwto return aProxy, even ifroutine is marked as
is raworis rwnumtypes default to0e0instead ofNaNsym(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&opento mean thespecial handles (use
IO::Specialobjects instead)IO::Handle.slurp-rest(use.slurpinstead)Any.flatmap(use combination of.flatand.mapmethods instead)Cool.path(use.IOinstead)Pair.freeze(usePair.newwith decontainerized arguments instead)Str.subst-mutate(useStr.substwith.=method call assign metaop instead)Rational.norm(Rationaltypes are required to be normalized on creation now)IO::Path.child(use.addinstead)&undefine(assignEmpty/Nildirectly, instead):countargument on&lines/Str.linesroutines(use
.elemscall on returnedSeqinstead)&is_approxin Test.pm6 (use the very similar behaviour of&is-approxinstead)New Behaviors
sub MAINvia new definable&RUN-MAIN,&ARGS-TO-CAPTURE, and&GENERATE-USAGEsubsQuantHashes/Mapin%variables andListin@variablescan be declared with
istrait (e.g.my %h is Set)<ww>regex rule: match within word onlynext/lastin a loop that collects its last statement valuesreturn
Emptyfor the iterations they run on.perlcan be called on consumedSeqs, multi-dimensional arrays,Date, andCallFrame.gistcan be called onAttributeUSAGEmessageis hidden-from-USAGEtrait to hidesub MAINcandidates fromauto-generated
USAGEmessageParameter.perlincludes introspectable defaults%*ENVvalues are allomorphic$;,$,,$.,$\,$(,$),$<,$>,$/,$\,$[,$-,$+, and$@throws
X::Syntax::Perl5VarHash.keyofreturns aStr(Any)coercer type object:42foocolonpair shortcutStrDistancestringifies to its.afterstringEnumeration.enumsreturns aMap.Rangeon various integer types returns the range of values they supportmin/maxroutines also work onHashesSignatureliterals can contain string/numeric literals aswell as the invocant marker
List.invertmaps via a requiredPairbinding, resulting inpotential type check failures
:existscan be used with multi-dimensional associative subscripts.firstProccan work withIO::Pipes from otherProcsmy SomeType @arrayand
my @array of SomeTypea
MixytoSetty/Baggy:nthadverb onm//accepts aJunctionas argumentCX::WarnandCX::Donecan be caught insideCONTROLphasernextcan be used inwheneverrequire'd symbols no longer transitively exposed{…}, similar to how it works with[…]ENDtime get automatically closedSeq, the cached list is used when&infix:<eqv>,.Slip,.join,.List,.list,.eager,.Arrayand.is-lazyare calledIO::Handle.encodingtakesNilto indicate switch to binary modeis defaulttrait works with attributesis rwtrait are considered narrower in multi dispatchthan those without it
.gistofArray,Blob, andMapgets trimmed to 100 elementsforstatement modifiershyper for,race for, andlazy forforloop automatically serializesRaceSeq/HyperSeq; use newforstatement modifiers
hyper for/race forto avoid&infix:<does>can be used with non-composable instances on RHSDateTimeobjectsPodpreserves the type of whitespace@-,%- and&-sigilledconstantsMath
Rationals are always reduced on creation and remainimmutable throughout their life
-Inf,Inf, andNaNcan be round-tripped through aRationaltypeby being represented as values
<-1/0>,<1/0>, and<0/0>respectively. Zero-denominator
Rationals are normalized toone of those three values
.Inton ±InfandNaNthrowsNumoperators and math functionsNum(-0e0) gets correctlyhandled by all routines and syntactical constructs
Numtype is required to be roundtrippableto the original
NumComplexexponentiation involving zeros.expmodare 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-listmethod is available onBaggytypes.categorize-listmethod is available onBaggytypes.invertmethod is available on coreQuantHashtypes.antipairsmethod can be used onQuantHashtypesQuantHashtypes have.new-from-pairsand methods to convert oneQuantHashtype to another (e.g..Bagmethod onSettype).hashonQuantHashtypes does stringify keysNew Parameters and Arguments
Date.newaccepts a:&formatter.firstcan take:kvuniqueand.repeatedcan take:&asand:&with&planin Test.pm6 can take:skip-all&run/&shellcan take:merge¬ecan be called with no argumentsopenaccepts:$out-bufferIO::Path.resolvecan take:completelyIO::Path.parentcan take anIntindicating parent levelProc::Async.newslurps positional argumentsSignature.ACCEPTSaccepts non-Signature/Capturearguments&EVALcan take aBlobPromise.keep/.breakcan be called with no arguments.sumon native arrays can take:wrapis requiredtrait can now take an argument indicating reasonIO::Socket::Async.listencan bind to port0to ask OS for a free port.encodecan take:translate-nlNew Routines and Operators
atomicintUnicode 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&callableon each element that behaves in such a waythat
&callablecan be applied&deepmap: apply&callableon each element, descending intoIterables&take-rw: like&takebut with a writable container&indir: execute code in a given$*CWD&spurt: seeIO::Path.spurt&prompt: prompt user for inputuniprops: multi-character version ofunipropsymlink: create a file symlinklink: create a file hardlink.hyper/.race: process a list of values in parallelSeq.from-loop: generate aSeqfrom aCallableStr.uniparse: parse one or more Unicode character names intothe actual characters
Str.parse-base: inverse ofInt.baseoperationIO::Pathprovides.ACCEPTS,.SPEC,.CWD,.Numeric,.add,.extension,.modeand numerious file tests,.parts,.sibling, and.spurtIO::Handleprovides.READ,.WRITE,.EOF,.DESTROY,.readchars,.flush,.lock,.unlock,.out-buffer,.tell,.say,.slurp,.seek,.printf,.print-nl, and.watchIO::Pipeprovides.procIteratorprovides.skip-one,.skip-at-least,and
.skip-at-least-pull-oneMu.emit: method form of&emit&fails-likein Test.pm6 module: allows testing for Failures&bail-outin Test.pm6 module: exit out of failing test suite&is-approxin Test.pm6 module: test a number is approximately like anotherBufhas.allocate,.reallocate,.append,.push,.pop,.splice,.subbuf-rw,.prepend, and.unshiftmethodsRangesupports.randBacktracehas methods.map,.flat,.concise, and.summary.classify-listmethod is available onHashtypes.categorize-listmethod is available onHashtypesCode.of: returns the return type constraintCode.line/.file: returns the line/file of definitionProc::Asyncprovides.Supply,.ready,.pid,.bind-stdin,.bind-stdout, and.bind-stderrProc.command/Proc::Async.command: the command we're executingProcprovides.signal,.pid, and.encodingComplexprovides.cis,.reals,.ceiling,.floor,.round,.truncate, and.absmethods and can be compared with<=>(aslong as the imaginary part is negligible)
DateTimeprovides.offset-in-hours,.hh-mm-ss, and.DateDateTimecan be compared with otherDateTimeobjects using<=>operatorDateprovides.DateTimemethod&infix:<+>/&infix:<->can be called withDuration,DateTime,and
RealtypesEnumerationprovides.Int,.pred,.succ,.kv, and.pair.Datecan be called on anInstantJunction.newcallListtype has.toand.frommethodsMaptype providesIntmethod, returning the number of pairsAny.skip: skip values in a listAny.batch: more basic cousin of.rotorMu.iterator: produce anIteratorfor values in a listIO::Spec::*types provide.tmpdir,.extension, and.pathPairprovides.ACCEPTS,.Pair, and.invert.Capturemethod is well-defined for all core types.ACCEPTSon allomorphsFailure.selfexplodes unhandledFailuresThread.is-initial-thread: are we running in the initial thread?Matchprovides.Intand.actionsIO::Socket::Asyncprovides.socket-portand.peer-portPromiseprovides alternative constructors.keptand.brokenWhateverCodeprovides.assumingWhateverCodeandBlockprovide.cando.:<…>syntax for calling prefix operators as postfixes$*KERNELprovides.hostnameNilhas.FALLBACKspecial method defined to returnNilNew Types
atomicint: a nativeintsized 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::Handles as if they were onestrarraysSupplier::Preserving: cached liveSupplyfactorySemaphore: control access to shared resources by multiple threadsIO::Special: a path to special I/O device (e.g.STDOUT)Exceptions::JSONan implementation of custom exceptions handler(can be used with
PERL6_EXCEPTIONS_HANDLERenv var)SeekTypeenum: values for use inIO::Handle.seekNew Variables
$*USAGE: available insideMAINsubs 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: anInstantrepresenting program startup time$*HOME: user's home directory, if one exists&*chdir: aCallablecontaining a variant ofIO::Path.chdirthatalso sets process's current directory
PERL6_TEST_DIE_ON_FAILenvironmental variable: stop testsuite on first failure
PERL6_EXCEPTIONS_HANDLERenvironmental variable: specify customexceptions handler class
Clarifications of Edge Case/Coercion Behaviour
UIntsmartmatchesTruewithInttype objectsinkstatement prefix explodesFailurespermutations/combinationson 1- and 0-itemlists and negative and non-Int arguments
&val,Str.Numeric, and otherStrnumeric conversion methodsfailwhen trying to convert UnicodeNocharactergroup or synthetic numerics
:42foocolonpair shortcutEnumerationcan now be used as a array shape specifierStrcontaining nothing but whitespace returns0nowsamemarkwith empty pattern argument simply returns the invocant.polymodcan be used withlazybut finite lists of divisors.[*-0]index is defined.rotorthat are larger than the sublist throwIntarguments to.rotorget coerced toInt.linesis defined when reading/procfiles++/--on stringsmapinside sunkforis treated as sunkforloop sinks value of last statement's method call.IntonBoolobjects returns anIntobjectsplicecan be used to extend an arrayclassifyworks withJunctions.pairupon a type object returns an emptySeq.pairupalways returns aSeqDate/DateTimeconstructors⸨/⸩pair can now be used as matching characters in quoting constructs.flaton anArraytype object simply returns that type objectclassifyonHashes throwsJunctions can be used to specify multiple keys toHashesCallablegiven to.classify-listis now guaranteed to beexecuted only once per each item
:deleteon associative lookup onHashtype object returnsNil&is-deeplyfrom Test.pm6 automatically.cachesSeqs givenas arguments and uses the returned
Lists for testingComplex.new()gives<0+0i>Int.newis now guarantied to construct a newInt(rather than, say,re-use one from a constants cache)
&infix:<=:=>and&infix:<eqv>are definedNiltype now throws if directly or indirectly calling.BIND-POS,.BIND-KEY,.ASSIGN-POS,.ASSIGN-KEY,.STORE,.push,.append,.unshift,.prependNil.ordreturns an emptySeqNil.chrsreturns a"\0"Num.newcoercers argument toNuminfix:<Z>()returns an emptySeq.combalways returns aSeq&infix:<+>with one item simply returns that item()[0]returnsNilSeqRangeobjectsSetconverted to aMix/Bagno longer hasBoolweightsgcdis defined when one or more operands are0Junctions autothread indefinedroutinesumcan handle lists withJunctionsin themGrammar.parselets topregexbacktrackU+2212 MINUS SIGN [Sm] (−)is now supported by more constructs,such as
Str.Numericand&val&infix:<~>works withBlobsNumericliterals are supported as value literals in signature\band\Bin regexes throwX::ObsoleteTrueandFalseas value literals in signatures warn.sortandIO::Spec::Unix.pathis alwaysSeq.AT-POSonRangeobjects returnsNilPair.AT-KEYfor non-existent key returnsNilCooltypes provide.Rat/.FatRatcoercersIO::Pathfiletests do not cache results of earlier test executionsSeqeqvListasFalsebased 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 #3519Hashes, andQuantHashes, values from.kv,.values, and.pairssequences are writable&infix:<∘>/&infix:<o>keep LHF's.ofand RHS's.arityand.count:in(…))IO::Handle.openIO::Path.Strdoes not include the value of.CWDattributeIO::Pathtype rejects paths with thenulbyte ("\0") in themIO::Pipe's.path/.IOreturn anIO::Pathtype objectIO::Path's.copy/.movefailif destination and original are the samedir-createdIO::Paths' absoluteness is controlled by the invocantCallablehandling,.definedcalling,and chaining of
&infix:<andthen>,&infix:<orelse>,and
&infix:<notandthen>operatorsSeqs does not cache themList.Capturestringifies keys of any containedPairobjects&failwith handledFailureargument marks it as unhandleduse libacceptsIO::Pathobjects^,^^,$, and$$are valid in lookaroundsGrammar.madesupports type objects.isasupportssubsettype objects:deletecan be used on lazy arrays&infix:<eqv>can work with certain cases of lazy arguments::(…)) is restricted regex syntax andrequires
use MONKEY-SEE-NO-EVALclearance.Slipand.Liston arrays with holesPromise.in/.atandSupply.intervalwork with zero and negative valuesSupply.intervalminimum value is0.001; lower values aretreated as
0.001and emit warnings # mentioned at https://docs.perl6.org/type/Supply#method_interval PR Mention 6.d standard value of minimal interval #2649Supplyprovides.Seq,.list, and.zipWhateverCodepropagatesuse fatalsay,note,put,print, andprintfroutines autothreadJunctionsIO::Handle.eofvalue changes accordingly when.seeking past end and back.succ,.pred, and.Boolon allomorphs.Bridgeon coreNumerics- [ ] Defined.Numeric/.Realon type objects of coreNumericsRational.Boolwith respect to zero-denominator rationalssay/noteguaranteed to call.giston subclasses ofStrJunction.Strreturns aJunctionJunction.gist/.perlreturn aStrMap/Hash's.list/.cachereturn aList.round's return typeEnumeration:Dnot does.ACCEPTanEnumeration:USee Bad propspec: Enum's :D accepts Enum's :U rakudo/rakudo#2073Miscellaneous
IO::ArgFilestype is just an empty subclass ofIO::CatHandle(i.e. using
my Foo constant @int) throwsX::ParametricConstantexceptionPod=defn(definition list) directive is availablePodprovides:numberedconfig key.^ver,.^auth, and.^namemetamethods are available onmoduleand are absent on a
package, by design’…’,“…”,「…」, and variants) are supported inqww<…>&infix:< >supports lookup of autogeneratedCallables(e.g.&infix:<XX>)anonsub no longer produces redeclaration warnings::?MODULE/$?MODULEvariablesub MAINcan accept anEnumerationtype constraint andwhereclause on arguments
startblocks and thunks get fresh$/and$!Rmeta operator used with list-associative operators is defined&infix:<x>/&infix:<x>throw with-Inf/NaNrepeat argumentsputandput forthrow, requiring use of parentheses$.method call syntax shorthand works with meta-methodsThe text was updated successfully, but these errors were encountered: