in reply to Re^2: why not listed foreach and if?
in thread why not listed foreach and if?

perl feed subs from right to left,

I don't know what that means? Both sub definitions and sub calls read from left to right.

Perl do checks if tail-loaded,

No, that's not the case for either the do function or the do block. Both start with do. They read from left to right.

Are you talking about do ... if ...;, do ... for ...; and , do ... while ...;? Those are just statement modifiers on a expression. No different than next if ...;, etc.

And again, you keep giving examples that defy your point. do ... while ...; is rarely used, I've never seen the others used, and I actively avoid them all.

Replies are listed 'Best First'.
Re^4: why not listed foreach and if?
by vincentaxhe (Scribe) on Jun 19, 2024 at 08:26 UTC
    "perl feed subs from right to left" refers code like
    print join ':', sort qw( b g a)
    as haskell '$' do; I do not like 'do {...}' at all, I wish perl accept more structures when if tailed.
      In open source, if you want something, the best way to get it is to write it yourself, especially if the idea doesn't seem to get much interest in others.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        Writing a patch might not help since the syntax the OP wants to introduce was explicitly rejected. I suppose it could be a first step in convincing others to change their minds?

        I'm sure it's a good propose, only change perl's core parsing rule can realize it or raise solid reasons against it, not by 'code style' nonsense, I can decide what I want to write.

      "perl feed subs from right to left" refers code like

      The action is on the left. The information needed for it follows. This is the opposite of what you say. This is an example of what we were calling left-to-right. It's the same order as for ( LIST ) BLOCK and the opposite order of EXPR for LIST.