Monday, January 26, 2009

TomAsp.Net on F#

"Thanks to the combination of C# 3.0 and F#, this article shows the ideas in a way that should be familiar to you in C#, but also shows a further step that you can take with a primarily functional language F#."

A feature that is usually present in dynamic languages can be very nicely used in statically-typed F# as well. Using F# quotations we can work with a representation of record field, which is in many ways similar to symbols known from Ruby (and similar features in other dynamic languages). Even though it is possible to achieve similar things by using strings using .NET reflection, the sample solution demonstrated here has one important advantage - the code is statically type-safe, which makes the code more robust.

No comments:

Post a Comment