Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created January 28, 2019 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/9d8716a081d62b01919eb54dfc5fbb06 to your computer and use it in GitHub Desktop.
Save Whateverable/9d8716a081d62b01919eb54dfc5fbb06 to your computer and use it in GitHub Desktop.
quotable6

it seems to somehow infinitely recurse or something like that
You'd need to recurse or have a pretty deep stack to fill the segment though
I think I've found a problem in the Async::Lock queue-on-recurse mechanism
so every time you recurse you add another simultaneous track of pieces that think they can have the lock
so keep as small a function as possible being recursed into
it recurses at least 99 depth when compiling nqp
i was especially happy i thought of making it so it doesn't recurse for when there's only 1 child. so we do 3-5 less times the recursive calls
The crashes are because we end up with more basic blocks now, and optimize_bb recurses
until someone (else) refactors optimize_bb not to recurse (and it's no less complex than the current implementaiton)
and then recurse
Not to mention that another therad may hit the out of memory condition than the one that infinitely recurses
okay, i probably have to assume my problem is that i recurse instead of doing my stuff flat?
i think it'd be really valuable if parse-string wouldn't recurse
oh, it seems like i recurse in parse-string instead of looping somehow
yeah, if it doesn't see a " after the escape sequence, it'll recurse
should this snippet recurse infinitely? class SQLString { }; my $stringy = Str.^find_method("Stringy"); my $handler = $stringy.wrap(method () { SQLString.new(:str(callsame)) }); say "foo".Stringy
if it should recurse/hang then we should be able to close https://github.com/MoarVM/MoarVM/issues/412 since jnthn has fixed the callsame bug which caused it to crash
/* Parse hex character code, and then recurse to do any further decomposition on it;
MoarVM: In cases where we have recursed heavily, we may end up needing to
seems like that's your only recurse.
How would you go about this: we have a function that recurses and there's a case to trigger a segfault by recursing to deep?
huh, did i infinitely recurse here?
it looks like afl-fuzz found a case where handling an exception causes a "cannot invoke null object" to be thrown, which will endlessly recurse through the exception handling machinery
Anyways, somehow it seems to end up with a Perl6::Grammar instance instead of a Perl6::Actions instance and then recurses endlessly
as dereferencing a frame derefs the caller pointer, too. and that can recurse
And yeah, you'd just recurse to encode the replacement string, or just do it once.
and then i could just recurse and try for a constant branch elimination
i'm now spec testing a change where i recurse into optimize_iffy if i just turned an if_o into an unbox-skipping thingie so that perhaps it can benefit from known values
One thing to try is to write something that recurses a 1000 calls deep or so
even if we still recurse and calculate all ze stuff?
and the confusion is that git clean doesn't recurse into sub modules
We don't recurse on the C stack.
that is only true in a very limited sense :-) we do recurse on the MVMFrame stack
Yeah, well, we basically never recurse on the C stack even if the code we're running does.

Rakudo::Internals.DIR-RECURSE needs to check that it does not try to recurse into non-readable directories (nqp::filereadable($!abspath)) for RT132110. although for it to still be able to return the unreadable path (and just skip recursing into it) might require a few other tweaks
actually slightly curious how much it recurses
yeah. needs to eventually not recurse
In terms of call stack - you can recurse as deep as you want, except you'll run out of heap at some point :)
japhb: still, having it recurse 1M times and still live, is something that I don't think P5 can do :-)
that infini-recurses?
can't see why it should recurse though
heh, my 'p MVM_dump_backtrace' recurses as well with a gazillion 'from SETTING::src/core/Numeric.pm:191 (./CORE.setting.moarvm:infix:<+>)'
samcv: There's depth-first or breadth-first; follow symlinks or not follow them, if you follow them, detect loops or not detect; stop when you find something or keep recursing; stop when you've recursed $n levels deep or keep going forever; stop when you found $X files or keep going, etc.
i wonder if it, like, endlessly recurses or something?
But I'd kinda expected the latter to not infinitely recurse.
samcv: when I comment everything but the"multi recurse-at-key(\SELF, \indices, 0)" it gives error yes...
okay. then take out this multi multi recurse-at-key(\SELF, [$idx, +@indices where { .elems > 0 }]) {
So it "works" (e.g. probably breaks if we recurse)
Why is it useful for token unsp to recurse?
MasterDuke: I think eval above is why <.unsp> recurses
So, that gets us our spectest that needs it to recurse, I guess :-)
jnthn: `unspace can recurse`, is that a sufficient and correct test description?
¦ roast: �Add a test that unspace can recurse�
For example, if a coercion method you rely on isn't yet declared at the time of the constant, it's easily possible to hit the case in Mu/Any and infinitely recurse
rakudo/nom: - don't recurse into any directory that starts with '.'
Hm. I see what the issue is. CompUnit::Repository::FileSystem basically recurses and finds all .pm6? files, slurps all of them, concatenates all of them, and then sha1s the result.
rakudo/nom: Under some circumstances duckmap could recurse indefinitely. The problem
And it recurses. So if there are more hashes and arrays, that's a lot of work. And yes, those %tokens in Dancer2 contain a lot of data.

jkramer, ufobat_, if the dispatch fails to find a matching candidate, but there's junctions involved, we call the junction fallback, which finds the appropriate junction object to thread and calls the function/method again once for each value in that junction, if there's multiple junctions in the argument list, it recurses
that's why it infinitely recurses
tree only recurses as deep as you give it arguments
mmh, so an iterative solution should be faster here, because then the compiler could see the 20 and optimize, rather than recurse down to 2
but other than that it'd recurse infinitely because i'm using @(self) insied method list
gfldex: so it tries to recurse into the same candidate
Also, basic block walking recurses on the C stack, and spesh graphs split up into more basic blocks, so it can end up deeper. There's an upper limit on the code size we'll specialize.
I wonder what recurses there
I usually go with a contextual parameter `$*indent = 0`, and then recurse
m: grammar A { token TOP { :my %*VAR; <add> <recurse> }; token add { a { %*VAR<a> = True } }; token recurse { :my %*VAR = CALLER::<%*VAR>; b }}; say A.parse('ab');
rakudo-moar aca4b9: OUTPUT: «?ab?? add => ?a?? recurse => ?b??»
m: grammar A { token TOP { :my %*VAR; <add> <recurse> }; token add { a { %*VAR<a> = True } }; token recurse { :my %*VAR = CALLER::<%*VAR>; b <add> { say %*VAR.perl } }}; say A.parse('aba');
rakudo-moar aca4b9: OUTPUT: «{:a}??aba?? add => ?a?? recurse => ?ba?? add => ?a??»
m: grammar A { token TOP { :my %*VAR; <add> <recurse> }; token add { (.) { %*VAR{$0} = True } }; token recurse { :my %*VAR = CALLER::<%*VAR>; b <add> { say %*VAR.perl } }}; say A.parse('abc');
rakudo-moar aca4b9: OUTPUT: «{:a, :c}??abc?? add => ?a?? 0 => ?a?? recurse => ?bc?? add => ?c?? 0 => ?c??»
m: grammar A { token TOP { :my %*VAR; <add> <recurse> }; token add { (.) { %*VAR{$0} = True } }; token recurse { 'b' :my %*VAR = CALLER::<%*VAR>; <add> { say %*VAR.perl } }}; say A.parse('abc');
rakudo-moar aca4b9: OUTPUT: «{:a, :c}??abc?? add => ?a?? 0 => ?a?? recurse => ?bc?? add => ?c?? 0 => ?c??»
can i tell the .perl method not to recurse into objects?
does .&?BLOCK make it recurse?
It's not a solution if it has a bug; and a rare to encounter too. You code recurses before exhausing the dir's Seq, and each dir uses a file handle
is there a clever way to check if a IO::Path is "under" another one? I can of course recurse on .parent until I have reached the root, but there must be a better way...
^ it basically makes a 1-el list of Array type object, then goes to descend into it and finds the inner Array and recurses and makes 1-el list with the type object and hence infiniloop :)
Ulti: I'm perusing https://docs.perl6.org/language/syntax right this second.. I've written a small program to recurse through some folders for certain files in perl6 but I need to learn to use more features like understanding the colon syntaxes that are used in several constructs
haxmeister: your script has a bug. You're not exhausing output of `dir` call before recursing into other dirs, so it'll crash when you recurse over enough dirs to reach maximum per-process open files. gfldex's version has it as well, except it hides the bug behind the `try`
I'm trying to write a grammar for the lambda calculus but anything I come with just recurses infinitely :I
yeah, bad idea. that'll also get you an expmod that can infinitely recurse (or iterate?)
that might recurse
you probably infinitely recursed instead of making progress
¦ Pod-To-HTML/WildYorkies-patch-1: group multis together, change a multi to a switch, utilize samewith instead of recurse, s/returns/--> Str/
zef would recurse tho
the way it is now it endlessly recurses
Basically you can either recurse only for matching keys, or iterate a .unique list of the combined keys of the two hashes into a multisub that only recurses when the keys match.
What does the docs mean when they say "flat does not recurse into sub lists"?
The user calls `format-bytes($some-number)` which internally calls `format-bytes($some-number, 0)` and then recurses on that internal function
ufobat: It's a bad idea because it'll recurse infinitely if PrimaryExpr doesn't match
I mean, you could argue that dd should not recurse that deep
gfldex: it will, but I'll end up in an infinite loop that way, because on iterable things I want to recurse down and perform my operation on each element.
harmil_wk: if you recurse, use a multi
hm, well, i guess since we recurse in dir i'd have to factor that in
you'll note that recurses in the actual matching call, not in the LTM transitivity calculator
even though it recurses and declares its own $count variable?
that somehow infinitely recurses
Zoffix: The rest of that section is bogus too; flat does "recurse into sub lists", it's just that the example given uses nested Arrays, which get containerized by their parent Array.
it only recurses for dirs
smls: or ... make dir() have a :recurse option :)
Well, it's a geometric progression of the number of x-1 arrows. That only gives you a sense of how absurd it gets as you recurse.
we do have flatmap, but that doesn't recurse
deep would be a recurseing iterator
it doesn't have a :recurse though :(
can't you recurse with the tokens so that you can see upwards and downwards?
doc: make it clear that flat doesn't recurse and show how to do that
parabolize: check metaops.pm for it's usage. Some metaops have the trait is nodal what decides if those ops recurse or stay shallow
I was actually suprised that "recursed"
well, simply rename documentation.perl6.org to doc.perl6.org will cause at least one link to recurse
I'm thinking of changing it to use .type.WHICH eq $basic.WHICH, but... is there a way to find out that a type is not user-defined and so I should not try to recurse into its .^attributes?
recurse?
Is there a way to recurse through callers comehow?
Hrm now that I look at the code snippet again, I wonder why it doesn't infinitely recurse.
From memory, it's a sub trait that controls whether hypering that sub over a list will recurse down the list or simply apply to the first-level list items
IIRC is nodal means that it will recurse
Interesting article: https://codewords.recurse.com/issues/six/immutability-is-not-enough
Xliff: and you can also recurse into $a.hash eqv $b.hash, I think
...have QAST::Compunit, want to recurse down it. what do I do? :)
Hi, all. I have been watching discussions here from time to time, but never intervened actively. So, my first intervention, with a question. I hope this is the right place for my question. Trying infinite recursion in Perl 5, with a subroutine like: sub recurse { recurse();}, I get the "100 levels deep in subroutine calls!" message. Just tried the same in Perl 6, and BANG! Anyone has an idea...
m: sub recurse() { recurse if $++ < 5000 }; recurse; say now - BEGIN now
m: sub recurse() { recurse if $++ < 5000 }; recurse; say now - BEGIN now
star: sub recurse() { recurse if $++ < 5000 }; recurse; say now - BEGIN now
lookfor is something that recurse a lot (the xml tree is quite huge/deep)
You'd need to recurse to do structure
Also a *lot* of care to not infinitely recurse
Wouldn't that recurse infinitely without annother multi?
.indent can't be replaced with ' ' x $indent ~ * because .indent actually checks how much indentation is already there. What I need for my usecase as I don't recurse around.
Else you will curse! And recurse!
pierre-vigier: ^^^ meta operators recurse into lists of lists
When exactly did generating backtraces on settings compilation failures start to recurse endlessly?
no obvious recurse bugs I can see in Pod::Coverage::Full.parse looks like something scary in the meta model methods has changed that introduced an infinite recursive case, which is beyond me to debug by eye :'(
i'd probably try to use Algorithm::Trie::libdatrie :) load up /usr/share/dict/words and go through the string char by chare walking down the Trie until hitting a terminal node, then push the words + remaining chars onto a stack and recurse/repeat
ingy, dunno. I've seen just one comment: "i'd probably try to use Algorithm::Trie::libdatrie :) load up /usr/share/dict/words and go through the string char by chare walking down the Trie until hitting a terminal node, then push the words + remaining chars onto a stack and recurse/repeat"
It think the profiler does not like stuff that recurse too much x)
nine: you know, if dir() had an option to recurse, File::Find could be obsolete :)
i should be able to recurse usion &?ROUTINE(...) right?
It removes, boilerplate from code, making e.g. stuuff that recurses over a data structure beautifully simple
its slow and the query recurse option seems broken
hmm, what would be a quick way to recurse a match object and print out all its non-empty .hashes (recursively)?
m: class Foo { method done { say "done" } }; await Foo.new # will that recurse endlessly?
$obj{$key} it infini-recurses
"to iterate is human, to recurse is divine". I infer that god has an infinite L1 cache.
No, I don't think paramterized types recurse typechecks into parameters.
roast/glr: >> is supposed to recurse into nested arrays. It seems like some bug on
moritz, so, this function now takes first $x then a start value for $y, then recurses till $y reaches 0 and returns a result.
You'll always encounter it in cases where an inner function recurses one of the inner levels.
$list.recurse(any(Seq,List,Array,Scalar), *.slip)
.flat :recurse
And a fallback slurpy candidate in Any will take the first one, apply that indexing, and recurse
so what that find() should do ? recurse into subdirs ?
Also, now that I've been spoiled by Perl 6, I'm really missing the ability to get at the capture values of recursed subpatterns...
Ven: maybe it recurses because you don't change the type of the second argument.
allow me to recommend https://codewords.recurse.com/issues/three/algebra-and-calculus-of-algebraic-data-types/ to anyone with an interest in Category Theory.
Actually, .deepmap *does* properly recurse into the keys of associative data structures like hashes. Updated the gist to show it.
I wonder if it'd be possible to turn this into a flat binary thing... every entry has an "id" field and the callees list doesn't *have* to recurse like that.
DrForr: 15 minutes is enough, as long as you can recurse :-)
ok, a proper cleaning did the trick (had to recurse to submodules, etc.) retupmoca, thanks for the hint
Heh. The profiler page doesn't much like hundred-ly recursed functions :P
so it doesn't recurse per se, it just reifies all until then
lizmat: Should it recurse?
readlink should not recurse
TimToady: how about a "desymlink" function that *would* recurse ?
although if the object were Iterable, then in theory deepmap would recurse into it
and it would make panda (and possibly other modules using File::Find) not recurse into e.g. .git
specs: will gladly recurse into .git when used by panda to find files to install.
what i've been thinking is: since dir itself doesn't recurse, a .grep following .dir would be good enough
timotimo: dir() should have an option to recurse though :)
moritz: if your call graph is big, the profiler will end up creating a gigantic data structure inside nqp code and then recurses around to build a json string from that
(And I use 'our' loosely here, because I've not made such a prediction that I can recall -- for reasons that recurse with my above statement.)
rakudo/lolly: Prevent infinite recurse on bare "zip"; fixes RT #119337
rakudo/nom: Prevent infinite recurse on bare "zip"; fixes RT #119337
m: sub recurse($pos is rw) { $pos -= 5; if $pos >= 0 { recurse($pos); }; }; recurse(5);
rakudo-moar 4fd1fd: OUTPUT«Cannot modify an immutable Int␤ in block at src/gen/m-CORE.setting:17323␤ in sub recurse at /tmp/I6dOVjIUGo:1␤ in block at /tmp/I6dOVjIUGo:1␤␤»
Do any of the submodules recurse?
Mmm, no reason in particular, though I want to be able to add a multi-candidate to pw-recurse in PTH and I guess putting them in the role made me feel that it was more likely to work :P
The problem is that my multi sub pw-recurse isn't getting called. Which is kind of expected
hmm. with &?BLOCK, can we just recurse into any block at all?
I don't understand why that recurses, anyway.
grondilu: it's a method 'new' with a call 'self.new'. it recurses...
sometimes we want to recurse first, sometimes not
i.e. apes cannot recurse
but machine code does not 'recurse' - or does it?
I suspect it ignores it and then just recurses forever :)
But now I've had a program do nothing but recurse for 2.5 minutes, and it's still running, so that seems OK
timotimo: maybe quibble recurses?
moritz: nice speedup upgrade would be to recurse all subdirs in parallel (if you don't care about the counter that is)
I forget, is @primes supposed to be usable withing the @primes definition directly? (Can you recurse within a binding definition, in other words?)
would that not recurse ?
eqv recurses through the proto at each level. Do you mean that you would do :by(&infix<eqv>) and thus get the caller's view of the proto?
i thought nfa just recurses into everything anyway?
how does it recurse?
r: class Foo { has Foo $.next; method recurse() { $.next.?recurse } }; Foo.new.recurse;
rakudo 484f08: OUTPUT«Cannot look up attributes in a type object␤ in method next at src/gen/CORE.setting:2450␤ in method recurse at /tmp/o5akfrG0tc:1␤ in method recurse at /tmp/o5akfrG0tc:1␤ in block at /tmp/o5akfrG0tc:1␤␤»
Well, at least the newest Rakudo does that. Mine just recurses forever
maybe git pull --recurse-submodules, or somesuch
timotimo: "the extend to which hyper operator recurse will be determined by properties of the methods involved"
regular expressions are just unions of all the words which is finite, its horrible but regular.. its only when its an infinite space of words its not regular because you have to recurse to express it
hopes masak++ doesn't find input where his t3 submission recurses infinitely
moritz: one contestant actually does recurse infinitely... :/
aiui, all a slang means is you recurse into a different grammar/actions pair with the same world, right?
Sort of like how perl5 produces a warning if you recurse too deeply
yes, anything that presumes a structure that would otherwise be recursed into
yes, also like Perl 5, moar is "stackless" isn't it? In that language level subroutine calls don't recurse at the C level?
r: sub Y(&f) { (sub (&x) { &f(&x(&x)) })(sub (&x) { &f(&x(&x)) }) }; sub g(&recurse) { say "oh the punnery!"; &recurse() }; Y(&g)
well, clearly it recurses... :/
it gets $*CWD as a parameter, which is something like "C:\foo", which looks non-absolute from a unix point of view, so it recurses trying to make $*CWD begin with a slash.
FAQ answer: "That's a nodal operator, so it doesn't recurse."
specs: but non-structural unaries to recurse when hypered. The best place to
was reading http://rosettacode.org/wiki/Anonymous_recursion#PicoLisp and thought that "recurse" would be a nice keyword instead of &?ROUTINE or &?BLOCK.
couldn't sleep, so he implemented 'recurse': https://github.com/perl6/specs/issues/37#issuecomment-17442034
r: sub postfix:<!>($n) { $n > 1 ?? $n * recurse($n-1) !! 1 }; say 4!
rakudo 5ad46f: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m�Undeclared routine:� recurse used at line 1. Did you mean '&reverse'?��»
moritz wrote: "How often do you actually recurse into anonymous functions in real-world code?"
grondilu: otherwise if your sub grows, and you refactor it by splitting stuff into a nother subroutine, you accidentally recurse into the wrong function
oh I see. valid point. I trust your judgment anyway. So I'm fine with no "recurse".
and actually I wanted "recurse" instead of &?ROUTINE mainly for aesthetic reasons, so it's not a big deal.
(and also because "recurse" is easier to type than &?ROUTINE)
jnthn: currently i'm doing a for over the parts and given a Positional i recurse and given anything else, i'll ".Stringy" and .join the rest of that
.tell diakopter same problem I'm dealing with re: DUMP(\()) -- it works its way down to a Hash, and then recurses infinitely. I'm betting a Parrot or NQP Hash is getting wrapped in a Perl 6 Hash somehow, and it when it tries to examine the Perl 6 Hash's $!storage and $!descriptor ... 10 GOTO 10.
07:36Z <japhb> diakopter: same problem I'm dealing with re: DUMP(\()) -- it works its way down to a Hash, and then recurses infinitely. I'm betting a Parrot or NQP Hash is getting wrapped in a Perl 6 Hash somehow, and it when it tries to examine the Perl 6 Hash's $!storage and $!descriptor ... 10 GOTO 10.
Since arrays don't naturally have an &infix:<+> defined on them, I believe it recurses there.
I just find the hyperops more predictable and useful when they don't recurse structurally.
if you want strictly shallow, I think you use .map . If you want strictly recurse, you use .deepmap . Hypers fill a space in between.
.oO(multi sub recurse1(%hash is copy) { ... }; multi sub recurse("internal", %hash is rw) { ... }; perhaps to avoid *all* the copying)
s/recurse\(/recurse1(/
r: my $a = \$a; say $a.perl # why does it timeout before recurse overflow
davidagain: the only change related to hypers i'm aware of since 2009 is that, aiui, they don't recurse in to their operands
.tree is supposed to recurse, not pretend to be .lol
If you're curious how it works: it coerces the incoming argument to a Capture and then recurses into the signature binding process.
Remeains of the time when >> was spec'd to recurse into iterables, I think.
diakopter: re better for ffi - it's better for interop with other runtimes as you avoid having runloops recurse into each other
jnthn: so i'm thinking i'll look at the code in find_symbol and modify it so that it enumerates all names and compares them against the given name, would that make sense or is there a simpler way to go through all symbols that exist? should i even recurse into Foo::* and Bar::* if i find them?
roast: RT #90522: recurse into eval
been able to recurse using subs in subs. got a pretty-printed graph now. it will only get more complicated now :|
hoelzro: the iteration recurses into the hash and applies .<id> to the individual values
Well, the full story is: we had it that way, then the spec changed to say it should recurse into things.
somehow the addition of class foo makes &foo() not recurse
perlOblivious: but if the previous group was producing a lazy list of possible universes, you just throw away the current universe and pick the next on off the list, and it automatically recurses into the group through the magic of lazy lists
still. why does it recurse
GlitchMr: hypers recurse into hashes too
no wonder it recurses indefinitely
As long as you don't recurse back into TOP, that should hold I think
they don't match it because it infinitely recurses, requiring one more 'a' each iteration.
Rakudo can't recurse in a token?
moritz: Marpa loves to recurse, so <~~> is a natural in that context
my $indentation = 0; sub recurse($a) { ++ temp $indentation; say ' ' x $indentation, $a.Str; recurse($_) for $a.children }
it seems my problems stem from the fact that X, would recurse into substructures or so
I have the following code @res.push: .map: { .key => recurse .value } What I need to do for the {…} to be interpreted as code instead of a hash?
nqp/toqast: Fix qalt_nfas to recurse to itself.
recurses into subdirs, too, so be careful :)
well, tree flatteners will recurse to the depth of the tree
jnthn: I think it's the same problem as the the recursed temp
roast: Correct and unfudge a test. This tweak is needed since the call is recursive (the spec uses that word), which presumably means it can recurse multiple times, and the test didn't provide a way for that recursion to terminate in its original form.
doy: custom types need to tell infix:<eqv> how to recurse, otherwise they'll be treated as leaves.
oh, Pugs confuses subs and methods, so it might have recursed infinitely on that one.
but + certainly ain't going to recurse...
reify can never reify more than one value at each level with that definition, and has to recurse through the laziness to get another 1
masak: got any example autopuns that recurse at least once?
rakudo/sink: [sinker] recurse into nested blocks
won't that recurse forever?
so that one shouldn't be sunk, because I don't recurse into PAST::Ops at all
masak: and note that p() recurses, so that can be equivalently written as a table
for sure, Perl 6 is becoming more existential, despite having been cursed and recursed for having too many lambdas... :)
Would it be plausible to have something act as a breaker, a "don't recurse beyond this point" marker?
should: the difference is that 1) map is lazy, >> is eager 2) >> recurses into arrays, .map does not and 3) >> does not execute in order, map does
and then recurses
I'm reading Rakudo's binder and I noticed a case where the auto-threader could be made to recurse without limit
(and thus refuse to recurse further)
jnthn: actually it doesn't recurse at all
doesn't work when it recurses
really? I thought the problem is that .mro returns a Parcel, and Parcel.gist recurses into the elements
PerlJam: no. Think of my $fib = sub { ... recurse into $fib ... }
wonders whether $x».foo should adopt a policy of attempting to dispatch .foo before trying to recurse, and only recurse if the dispatch to .foo fails
so, when you say "recurse", you're only talking about one level?
is starting to think that making ».foo recurse by analogy to dwimmy «+» is probably a mistake, having wanted ».[0] to work more often than wanting a tree walk
>>+<< would still recurse?
flussence: you try without declare recurse-node without Pod::Block type ?
tadzik: does it at least print out that "In recurse" bit?
probably - git clean doesn't recurse into other git trees
pmichaud: Essentially as we "recurse" into a data structure, we containerize things with an immutability marker on the way down?
satyavvd: >> recurses into data structures
roast: It assumed that >> and << hyper ops do not recurse into nested data
oh! >> recurses down!
masak: I am not completely sure that I like >> recursing; my mental model is just that it hypers over a single layer of list, but we need *something* that can recurse.
rakudo/nom: Run recurse.t after fixes by pmichaud++.
roast: 3a7b996 | jonathan++ | S06-advanced_subroutine_features/recurse.t:
pmichaud: Just ran into it after fixing the other reason recurse.t fails.
"How to mutually recurse yourself to a sierpinski DAG using Perl 6." :)
so that when you do addition inside of your sub infix:<+>, it recurses. and fails to bind the (now Int) argument to the parameters.
(I don't know, maybe .flat is supposed to recurse, but currently it doesn't in rakudo)
it must not recurse
and recurse
(since [+] already recurses, I mean)
and high-level things like term still have to recurse down through many levels despite knowing their "fate" in advance
fwiw, I think that rakudobug (the fact that it recurses infinitely) is fairly severe. it's not a terribly uncommon use case to want to slice up to *-1.
er, recurse
Which recurses...
However, it doesn't do that at all - it just recurses.
Or even if it recurses.
isBEKaml: yeah, particularly for euclid's algorithm, which shouldn't recurse too deeply
and since $/ doesn't flatten, it recurses infinitely
I'm more thinking of the fact that Parrot's mark recurses on the C stack
The rough "My platform's native calling conventions don't support all of the operations I need to do, so I need to do something clever in them so I don't recurse forever and still support the non-linear control flow I need."
as long as you don't recurse into the function that has the gather-block (but maybe into a helper), that's fine
which iterates over the argument, and recurses into self
I know why it recurses
recurses into self
actually, dir('...')->recurse() is comparable to File::Find :)
the Parrot GC recurses on the C stack when marking objects
nearly all of my scripts that recurse throug directories, list them etc. contain separate logic just to ignore them
jnthn: but it doesn't recurse like find, does it?
isn't map supposed to recurse into nested structures?
moritz_: there's a type-mapping mechanism so you can control the mapping on a per-project basis. Unmapped types get recursed into (by default) so a whole tree of .pm6 files get generated.
r31445 | bbkr++ | [t/spec/S05-substitution/subst.t] tests for RT #66816 Zero-width substitution makes the GC recurse
r31396 | sorear++ | [Cursor] A more platform neutral way to recurse the parse
Just coerce the parameter to a Capture and recurse into the binder again using the nested signature and the capture.
and if the arguments happen to be arrays, it recurses into them
pmichaud: In fact, in a nested signature case, we just .Capture the argument to coerce it into a Capture and recurse.
cognominal: would the above be enough? seems you can recurse in subtype declarations.
TimToady: How does $ALL<UNIT> interact with being able to recurse into other compilation units?
Perl spits out a warning when code recurses more than 100 levels (yes, hard coded) deep
Moose recurses over the inheritence graph -> warn if more than 100 levels of superclasses
does regex parsing recurse into the nqp-rx grammar, maybe?
I often find myself having a public method that does some prep for the recursion and then calls some over thing that's private and recurses (so the fact it's implemented recursively isn't part of the interface).
viklund: just recurse three times! :)
r30184 | jnthn++ | [t/spec] Unfudge 8 tests in recurse.t that Rakudo passes.
rakudo: Turn S06-advanced_subroutine_features/recurse.t back on.
{} # don't recurse in lexer
colomon: is hyper really supposed to recurse like that?
pmichaud: Well, it knows to recurse.
too bad it didn't recurse :-)
shows up with a patch for var traits, after an adventure involving making POST::Compiler recurse infinitely. Oops.
So when a snotty kid (e.g. me) points out that the computer _does_ do several things at a time, and that apparently my brain does, too, the person with the analogy recurses into an infinite loop of circular logic.
rakudo: Make Rakudo_binding_bind_signature actually take a low level signature object rather than an already unpacked one - this will make it far neater to recurse into the binder later. Also, cache the nameds to positionals hash. Doesn't actually win much performance, though we're building probably several less PMCs per dispatch, so less memory overhead for sure. Also remove a leak.
but wouldn't we have to complete binding into a call before we can recurse?
r28615 | /[/]/ no longer recurses forever
i know you can turn the current part of the tree into a hash using %() but it doesnt recurse down
but the hyper-ops don't recurse, do they?
I don't see that use case needing a hyper-op. even if hyper-ops do recurse, that is.
just make .add_nodes recurse on its own.
And what's two small adverbs (that will be needed in quite a few cases), compared with having to loop and recurse?
it uses Coro::State to be able to recurse smop -> p5 -> smop -> p5
I'm not sure why it *doesn't* infinitely recurse in fact...
it seems to recurse on the empty list
infix:<add> is also a macro, so it have an influence, though it certainly shouldn't recurse like that
so if you ever need to recurse through a tree of Matches, Grampa's the thing.
because what about defining methods which you do want to recurse into themselves?
yes. if it follows the Perl 5 standard, it should recurse the nested contents, comparing all.
DanielC: it'll infinitely recurse
If it doesn't find a <Value>, it'll infinitely recurse (in PGE)
pmichaud: Because then rather than walking through an array we gotta then go recurse and so on.
re always flatten: So while it traverses and copies elements, it notes if items themselves have the Positional role, and recurse into them?
the harder issue is the way p5 recurses in the C stack
not everything... when you 'require', it will still recurse in the C stack
moritz_: I'm trying my best to recurse through a tree of Matches, but I'm still only dragging up buckets of frustration.
moritz_: I've done the parse and the action methods. now I want to recurse.
@tell pmurias I know why it's breaking when the refcount is on... nagc really can only be used in the msot basic types, it shouldn't be used when the DESTROY call recurses, we need an additional gc that is able to handle recursing in the interpreter... just as lowlevel.sm0p did...
masak: I didn't look to see if \(1,2,3).perl.say has an RT bug yet (recurses infinitely)
but if I add self.f() it will recurse again
Thing is if you just write 'roots' it calls the one in the current namespace...which is the one you're currently in...so I fear what you already had may recurse infinitely.
r25892 | ruoso++ | [re-smop] solve the last circular dependencies by defining two new modules... nagc: native-types garbage collector (doesnt call DESTROYALL as a method) and lost: LOwlevel-STate machine, which implements a simple way of writing C code that doesnt recurse in the C stack.
pmurias, ok then... I think it's lowlevel.sm0p that checks if the interpreter is the prototype one recurses directly instead of creating a mold
But it currently infinitely recurses
I'm not sure we always want to recurse.
well, you don't have anything that checks for a value of $recurse. :-)
I think you always do, and the $recurse is just stolen from prove
but the current behavior would have been to not recurse.
$recurse is only there once.
IMO, an argumentless `prove` should recurse from the current directory, or something.
i guess prove --recurse t is drawing a blank. maybe call file_or_dir( '/home/masak/yada/t' )
ruoso: what methods on an interpreter are guaranted not to recurse
loop and eval certainly recurses
pmurias, ok, I was using MOLD_DEBUG and I forgot that not every DESTROYALL call recurses
if you recurse in that function you overwrite the stack
if we're serializing the package... we have to serialize "a link to Foo", not recurse into serializing "Foo" itself
the evaluation of BEGIN recurses in the C stack
misses a construct like a recurse map...
@foo = recurse-map { .isa } { .variants } $object
so we would need to change the macros so that instead of doing the call, it would save the current stack and recurse without using the C stack
the biggest problem will be the C code that recurses back into the interpreter
pmurias, because I'll have to recurse into the C stack to traverse the array
it doesn't recurse or anything. It's just one level deep flattening.
r22085 | moritz++ | [t] simplified blocks/recurse.t a bit, used is() instead of ok()
r22086 | moritz++ | [t] moved blocks/recurse.t to spec/
r22087 | moritz++ | [t/spec] recurse.t: use numeric comparison where appropriate, fudged for
grammars work fine for me as long as I don't recurse :(
hm, we recurse, so far without problems
and it needs to be done that way... because DESTROYALL might recurse, so free needs to be called after DESTROYALL returns...
but remember that .bool() might recurse
Arathorn: because it doesn't use the C level stack to recurse into python subroutines/methods
pmurias, SMOP_DISPATCH returns a value so that when that node doesn't recurse, the return value can be taken....
but setr is used when you recurse and need to return the value to a previous frame
pmurias, that allows special casing objects that are allowed to recurse in the C stack (interpreter calls, frame calls etc)
moritz_, if we do it in C we're going to recurse in the C stack
pmurias, but remember one very important aspect of your implementation, that it should not recurse in the C stack...
pmurias, as long as it doesn't recurse without returning...
because the calls to Str might need to recurse
the fact that you would need to recurse, and the CurrentFrame wouldn't be the frame you want to move the values from
if the object is SMOP__NATIVE__int, the destruction code recurses in the C stack, otherwise it uses CPS to call DESTROYALL on the object...
some will recurse
where cdepth used to mean concatenation depth before I renamed concatenation to all(), which recurses down to both()
and only returning when need to recurse into the SLIME stack
we can override the ops that recurse
and allowing p5 to recurse as it wishes
... then the operator() routine would recurse deeply all the possible precedence level detectors, identifying which one matched based on the recent matches
spinclad: oh,right. duh. my $say_to_string is context = 1; ... sigh. build .say on a .say_to_s ? then recurse on the .say_to_s
then call to destruction and stuff would not recurse
as long as it doesn't recurse ad infinitum
it can't recurse as the responder interface is a lowlevel thing and it's fields are accessed in a non-oo way
don't recurse using the C stack
which may need to recurse
it can be simple as recurse in the C stack and hold a reference to the p5 interpreter so it can callback
'the native capture have a new important method called "may_recurse"'
r19605 | ruoso++ | [smop] native capture lowlevel c calls receive the interpreter reference, as they may need to recurse to call WHICH in the case of named arguments. But fortunally, the constant identifiers come to rescue and enable the bootstrap.
actually... I should consider that manipulating a capture in lowlevel c calls cannot recurse at all... so, the lowlevel capture calls won't accept named arguments that are not constant identifiers....
but this same type will accept it through high-level calls that will be evaluated in the interpreter loop, that then will have how to recurse to call WHICH...
r19614 | ruoso++ | [smop] the native capture have a new important method called "may_recurse". This is only true when there are non-constant-identifiers in the capture. Some low-level classes (like slime) cannot recurse, and therefore it is a deadly error to try to create a new slime object with
hmmm... that "may_recurse" thing kinda saved the day now... :)
as long as perl's runloop is reentrant you can recurse back into it
but the C stack doesn't recurse
pmurias: misc/token-test-recurse2.pl and others, it's assorted Perl 6 or Perl 5
kp6-kp6 no longer recurses when parsing a 'say "Hello!"', but the match simply fails
is not your changes that make it recurse
r17833 | ruoso++ | [kp6] && and || implemented as short circuit... test 11 no longer recurses ad infinitum, but still fails...
if the extended list (@x, *) is not treated lazily, it recurses forever. pugs (in run.pugscode.org) also has problems with 1..*
perl kp6-perl5.pl --perl5rx < examples/token-test-recurse.pl | perl -Ilib5regex -Ilib5
you actually have to handle recursion. if you are supporting p5, the only way to get p5 local() in embedded code blocks to work properly, is to actually recurse, since there is no other way to fiddle with local(). if you are just doing p6, then you have control, so you can use a stack machine, or whatever. then the question is whether you're targeting
mncharity: http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/examples/token-test-recurse.pl
: [kp6] added examples/token-test-recurse.pl
: [kp6] examples/token-test-recurse2.pl - a recursive regex example
please do: $ perl kp6-perl5.pl --perl5rx < examples/token-test-recurse2.pl | perl -I lib5regex -I lib
$str =~ $rx; if (pos($str) == $a_pos_that_matches_where_it_should_recurse) { recurse($str, $nextrx) }
Is there anyway to get svk info to recurse when you do it in a checkout of a local copy of a mirror? I'd like to see the rev of the actual source repo, but svk info in a WC of a local copy of a mirror only shows revs back to the mirror ...
OK, what am I doing wrong here: pugs> sub recurse_list(*$head, *$neck, *@tail) {return $neck unless $head; return recurse_list(|@tail);} say recurse_list(2, 5);
*** No compatible multi variant found: &recurse_list
where did it recurse?
so a tail-recursed caller is always outside the recursing func?
course, that recurses
I just then need to remember not to recurse below that depth
so -<< still recurse, just not arbitraily extend?
declare: (?<NAME>PATTERN) backref: \k<NAME> recurse: (?&NAME)
r14080 | audreyt++ | (again) recurse into subarrays.
(This implies that I think hypers should not recurse, as lists of lists don't exist)
in which case it has to recurse
I think that's a very useful operator, one that does recurse
However, the current way means that there's no way to NOT recurse.
audreyt said 1d 3h 54m 5s ago: I'm dropping support for [+]<< because << recurses into subarrays and so [+] never got a chance...
@tell TimToady I'm dropping support for [+]<< because << recurses into subarrays and so [+] never got a chance...
r13770 | audreyt++ | as specced the hyper will recurse into arrays, so the reduce
audreyt: does that recurse into the structure, or just one level deep?
fglock: rule_recurse. the 2 tests are different. if you change the 2nd test from "x" to "" it works.
just recursed through a bunch of directories, and all looks okay
the recurse limit of 100 is hardcoded?
within a named sub foo () { ... }, foo() should always recurse, should it not?
but i called out to the other one without qualifying its name, so i should have recursed
recurses! foiled again again again again again...
at least it didn't recurse into bitvoid
r12606 | bsmith++ | Add directory and --recurse support to prove6, just like prove.
r12342 | Sage++ | The translator test script is now recursive. Just run it in a directory and it recurses through all .yml files and tries to translate them.
isn't === supposed to be value oriented, and more DWIM in that it also recurses downwards?
also, i don't think it's going to recurse
(That's basically how the P5 engine works with respect to itself--it recurses deeper to test the following pattern, even if that following pattern is "shallower" in some sense.)
.perl:recurse_limit{undef}.as:type<buf>:filter<bz2>
so 0 -> 1; 1 (recurse once ) -> 1; etc
and then it recurses the tree, tries to match the sub optimizers to tree nodes, and then return a transformed tree
it doesn't recurse though
it tries to recurse to Pugs::Emitter::Rule::Perl5::concat()
Because it did a recurse last week when I was testing Vanilla Perl :/
a recurse?
so your parser, given ... * ,,, with * rule defined early, looks ahead through the input to match *, with two unprocessed strings ... and ,,, , and then recurses on them?
Then recurse with b:c:d:rest
audreyt: so, emitting the tag doesn't work because we (oughtta) find out the blessing at the reference level, but that's where we hit 'case SVt_RV' and immediately recurse into perl_syck_emitter_handler again. too bad there's no way to pass an implicit arg here too :)
audreyt: the emitter callback gets some sort of Val node and recurses into it, but how does it know about Val? You suggested a Val->SyckNode (or YamlNode) function, but how to import it?
...(sym, expMaybe) <- option... recurses
so you have to pass it as an arg to itself,.. call-by-value,... then you can recurse
Pick a point half-way between you known points, and then recurse
kane_: IO::All has $io->all to recurse dir trees
Is there somewhay to tell perl to recurse deeper?
QtPlatypus: recurse deeper?
Does it rm -rf? IOW, can I just add dist/ and it will recurse properly?
fglock__: no idea. the smoke of current state is still running, and I haven't done any specific tests. the test which recursed was...
In outline, I had code that would recursively look up pages in a database via DBI, extract the attributes, create a few objects, call a few methods, generate a big tree by parsing a markup language with an amazingly primitive regex-based parser, recurse down the tree to generate HTML, and finally spit the HTML out. The parser did a ton of string twiddling--I never did any formal profiling,...
having small sanity tests, like the current ones, allows one to do a hill-climbing design-a-bit, code-a-bit, test-a-bit, recurse. But I'm not sure that's actually useful... If PIL2 was done, I'd say you document and annotate it, sketch implementation approaches, and then do a broad push implementation. The design-a-bit part is just asking for pain, if you have access to the big picture. And if you have a broad implementation front,
nothingmuch: Hm, to the problem is that it recurses too much... @array ~~ @other :recurse(0)
so why not have @array == @other :recurse(0);
and it recurses all the children of some_dir
integral: ok, but, umm, does map() recurse when iterating over a list or is it smart enough to not do that?
ods15: it recurses
it can't not recurse
ods15: it does recurse
yes. PGE happily recurses to boom on that.
ah, it's so that :meta('Perl6::MetaClass') doesn't recurse?
Should the above rule recurses infinitly? And should it cause a bus error?
I can see it recurse, but bus error is intolerable
How *do* you define two words so that they can mutually recurse (instead of the second definition dying from unrec. word?)
in fact, next recurses into the while loop
redo needs to recurse, so that should use genSymPrim. last and next do not, so they need genSymCC.
OK, granted I don't know Haskell all that well (I'm basically reading it like an Italian reading Spanish), but it looks like the redo concept is "tail-recurse the loop block"
except it tail recurses the conditional and the body
I don't know the state of pge re recursion. You can recurse in pcre (using names), and in p5 (using code returning regexes).
recurse, svp . . .
= on an iterator that recurses down t from perl
Assuming a glob that recurses for **
So earlier this week (before family came to visit), I went to write some tests for pugs . . . but I couldn't get them to work because of Test limitations . . . and I couldn't work around those because of pugs bugs . . . and recurse.
And unfortunately in trying to test for it, I just recurse into issues with Test.pm, and issues with use of normal P6 modules, and so on.
Right, don't want to recurse forever.
yep, SUPER doesn't recurse anymore
Does the last case recurse?
"maybe" does not recurse.
ithreads would be much nicer if you didn't have to manually recurse.
I have some simple recursion tests I wrote. I assume they should go into t/subroutines/recurse.t? the subs are named horribly right now, should I just check them in and perhaps someone else can think of better names?
Khisanth: no it wouldn't work since it would require you to specify a scalar and a list as your two args, and the length recurses in such a way that would not work
didn't notice awwaiid recursed
i think its command line should mimic prove's, so it shouldn't glob but should recurse
that does recurse
and recurses them
no, it's supposed to recurse, running findVar' on the highest env
so how do we recurse upwards through the env stack?
dada: looks like you need to iterate ... er recurse ;)
t\op\recurse timed out
autrijus: the recurse.t still skips though
Er, so the user has to recurse in to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment