Subscribe to this list via RSS Blog posts tagged in anonymous methods

Posted by on in Programming
How to handle data in TFunc with C++Builder(BCC32) When dealing with TFunc in BCC32(C++Builder 10.2). For example, suppose Delphi side has the following function. type Tproc_func = record {When TFunc is an argument as shown below. } function func1(func: TFunc<Integer, String>):String; end; implementation function Tproc_func.func1(func: TFunc<Integer, String>): String; begin Result := func(CurrentYear); end; The func1 function has an argument of TFunc.In this case, Delphi...
Developer Skill Sprint: Delphi Anonymous Methods And C++11 Lambdas I am doing a Developer Skill Sprint this Tuesday, September 22, 2015, titled "Delphi Anonymous Methods and C++11 Lambdas: When to use them and not use them". This blog post contains some of my notes and resource links for my skill sprint. What will be covered? Delphi Anonymous Methods C++11 Lambdas Parallel Programming Library When to use them / When not to use them Advantages of Anonymous Methods and Lambdas Easy way to define and use methods Easy to parameterize using code Bindi...
Object Pascal "Mind Your Language!" Dev Direct webinar source code The fourth season of Embarcadero EMEA "Developer Direct ONLINE!" webinars is half way! There are still three more episodes to go, 30 minutes every second Friday at 11am Amsterdam (10am UK) time. With every webinar we have more attendees and you can still register at embt.co/embtdd4 Today I had a pleasure of talking about some of the cool Object Pascal programming language features that were introduced in recent Delphi versions, including: Type helpers for primitive and custom types Gene...

Posted by on in Blogs
Implementing Memoize in Delphi 2009 My last series on Delphi 2009's generics was self-consciously investigating a corner case.  This post, however, is going to bring us back to Earth very quickly, so prepare for a steep descent!  I'm going to implement a useful, higher-order function, Memoize, using Delphi 2009's generics and anonymous methods. Memoization is a generic solution to the problem of caching function results. The function Memoize accepts a function as an argument and returns a function which does exactly the same th...

Posted by on in Blogs
My Programming Language (Delphi) Can Do This joelonsoftware asks on his blog "Can Your Programming Language Do This?". Delphi 2009 introduces support for anonymous methods in Delphi language. Yes, Delphi can do this:-) For your convinience here is the relevant snippet from Joel's blog: Delphi, contrary to JavaScript, is a strongly-typed language. This is the reason you need to define an anonymous method signature.  I think it is a good thing. Here is the output from a simple console application: I have my private th...
  • Page :
  • 1

Check out more tips and tricks in this development video: