Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: RFC: Inline::Blocks or inline as a keyword?

by LanX (Archbishop)
on Sep 09, 2018 at 21:34 UTC ( #1222004=note: print w/replies, xml ) Need Help??


in reply to Re^3: RFC: Inline::Blocks or inline as a keyword?
in thread RFC: Inline::Blocks or inline as a keyword?

Are you saying you are dynamically generating code for your type checks which is eval'ed?

Not sure if that's the meaning of "inlining" in this thread.

Probably I'm missing your point...

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^4: RFC: Inline::Blocks or inline as a keyword?

Replies are listed 'Best First'.
Re^5: RFC: Inline::Blocks or inline as a keyword?
by tobyink (Canon) on Sep 18, 2018 at 08:23 UTC

    The ArrayRef and Int type constraints are smart enough to know how to combine to make an ArrayRef[Int] type check which inlines the Int check inside a loop over the array. This inline code is evaled within a sub { ... } to create a single coderef which checks that a value is an arrayref, and all elements in the arrayref are integers.

    That code can also be retrieved as a string for inlining into larger coderefs like constructors, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1222004]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2019-11-15 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (85 votes). Check out past polls.

    Notices?