Visit site Delphi sorcery

May 2017

1
vote
Vote UpVote

How to create an operator overload that only accepts nil

Delphi sorcery – Since the introduction of Nullable types in Spring4D they had a problem: assigning null to them was cumbersome. Some time ago you could implicitly assign a Variant to them which made it possible to assign Null. However that caused some issue because of implicit Variant type conversion.Imagine you ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2017-05-12 00:39
0
votes
Vote UpVote

I wish I had dcc32 -dontmakemycodeslow

Delphi sorcery – Quick, what is wrong with this code performance wise?function TWhereIterator<T>.MoveNext: Boolean;var current: T;begin Result := False; if fState = STATE_ENUMERATOR then begin fEnumerator := fSource.GetEnumerator; fState := STATE_RUNNING; end; if fState = STATE_RUNNING then begin ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2017-05-11 21:37

February 2017

4
votes
Vote UpVote

Generics, modules and typeinfo

Delphi sorcery – The goodWhen working in a loosely coupled software architecture you might be using different modules: packages, dynamic link libraries and typically a host executable that loads them.If you are using a DI Container it is very easy to extend functionality by just putting that into one module and once ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2017-02-23 18:48

June 2015

3
votes
Vote UpVote

Anonymous method overloading

Delphi sorcery – A few weeks ago I learned about Knockout.js which is a very lightweight JavaScript MVVM library. It contains of some basic features which you can read about on their home page if you are interested.I quickly was amazed how great their concept of observables works (I love design patterns on ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-06-26 22:56

May 2015

2
votes
Vote UpVote

Extending the Spring4D DI container - lifetime managers

Delphi sorcery – Today we got the request to support TInterfacedPersistent in the DI container.As you may know TInterfacedPersistence does not do reference counting like TInterfacedObject does - or to be more precise it delegates it to its possible owner. Usually the owner will be nil so it does not do ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-05-07 21:18

February 2015

5
votes
Vote UpVote

Type less - how to use GExperts macro templates

Delphi sorcery – With all these articles and presentations about the PPL you might have seen this often. Calling TThread.Queue (or TThread.Synchronize if you are doing it wrong ;)) to execute your VCL or FMX related code in the main thread.Are you still typing this code wasting precious time? Well then this article ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-02-21 19:02
7
votes
Vote UpVote

Extending the parallel programming library

Delphi sorcery – Recently Robert Love blogged about Exception Management in the PPL (let's please stick to this abbreviation since that is what Embarcadero calls it).What I was missing though was handling exceptions in fire and forget tasks since you usually don't have some place that calls wait on them ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-02-21 16:57
20
votes
Vote UpVote

TestInsight - unit testing like a pro

Delphi sorcery – The time of teasing is finally over - today I want to show you what I have been working on over the past few weeks:TestInsight is an IDE plugin for Delphi (supporting XE and up) that will improve your unit test experience. It integrates nicely into your IDE removing the necessity to deal with some ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-02-07 15:46

January 2015

7
votes
Vote UpVote

New dynamic array type in Spring4D 1.2

Delphi sorcery – Today I want to talk about dynamic arrays. Often you might prefer them over a full blown generic list because it avoids creating an instance just to store a couple of elements (which are backed by a dynamic array inside the list anyway - at least for a regular TList<T> regardless if you use ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-01-29 23:18
7
votes
Vote UpVote

The Either type for Delphi

Delphi sorcery – In a previous post I talked about the Maybe type that similar to the Nullable type allows you to handle values or the state of having no value in a functional approach.Today I show you another type that is common in functional programming - the Either type. It allows you to return 2 different ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-01-25 13:52
7
votes
Vote UpVote

Never return nil? Maybe!

Delphi sorcery – I admit - such headlines are getting old - at least for those that know a bit about functional programming. But for those of you not familiar with the term monad it might be new. But don't be scared though by all that functional programming gibberish in that Wikipedia article.Today after Nick's ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-01-21 01:02
8
votes
Vote UpVote

Smart pointers in Delphi

Delphi sorcery – Yes, I know - I am way to late to that party.But this is yet another thing that the language itself is missing but can be done with some tricks as the posts showed. However I felt in all these implementations something was missing. Barrys first implementations were record based which ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2015-01-08 02:29

October 2014

10
votes
Vote UpVote

The real power of generics

Delphi sorcery – I just watched the "Effectively Using Generics in Object Pascal" Code Rage 9 session by Ray Konopka, where he showed a great introduction to generics which is mostly about putting things into lists, dictionaries or other data structures. So basically container types what generics are great ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2014-10-29 19:51
7
votes
Vote UpVote

Generics and variance

Delphi sorcery – When working with generic collections there is often the question: "Why can't I just assign my TList<TPerson> to a variable of TList<TEntity>? TCustomer inherits from TEntity!" There is something called covariance and contravariance - but the bad news are: Delphi does not support ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2014-10-09 23:46
14
votes
Vote UpVote

New language feature in XE7

Delphi sorcery – Nope, not the dynamic array enhancement that everyone talked about already.In fact I am going to show you something that I haven't seen anyone talking about yet.It wasn't even mentioned on the official XE7 shows and the reason probably is because it is not been finished completely as in used in ...
Details Favorite? Off-Topic? noreply@blogger.com @ 2014-10-03 17:30
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)