quotations

Is this an F# quotations bug?

[<ReflectedDefinition>] let rec x = (fun() -> x + "abc") () The sample code with the recursive value above produces the following F# compiler error: error FS0432: [<ReflectedDefinition>] terms cannot contain uses of the prefix splice operator '%' I can't see any slicing operator usage in the code above, looks like a bug... :) Lo...

Quote about how many percentage of good code is error handling?

In one of the earliest podcasts I remember Jeff Attwood in the StackOverflow Podcast mentioning a quote about how x % (where x was something like 70 or more) of all good code was error handling. Does anyone know the exact quote? I can't seem to find it any more... ...

How to do fixed price quote for design sessions?

Normally when I do a system for a customer, I do design sessions on an hourly rate and then come out with a fixed price quotation for the full system development. Now this customer has thrown me a curveball: he doesn't want an hourly rate for design, either - he wants me to quote a fixed price to do all the design, too! Not that he's t...

embed a variable inside an f# quotation

i'm writing an F# dsl for SQL (http://github.com/kolosy/furious). A select statement would look like this: type person = { personId: string firstname: string lastname: string homeAddress: address workAddress: address altAddresses: address seq } and address = { addressId: string street1: string zip: st...

F#: Quotation with type definition?

I'm playing around with quotations and I can't see an expression pattern for type definitions. Is there really not one, or am I missing something? <@@ type MyType (name:string) = member x.Name = name @@> Gives "Unexpected keyword 'type' in quotation literal." ...

Generating parameterized F# quotations

Let's say we have a simple F# quotation: type Pet = { Name : string } let exprNonGeneric = <@@ System.Func(fun (x : Pet) -> x.Name) @@> The resulting quotation is like: val exprNonGeneri : Expr = NewDelegate (System.Func`2[[FSI_0152+Pet, FSI-ASSEMBLY, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, mscorli...

What are F# quotations?

What are "quotations" in F#, and what are they used for? ...

How do I match a pattern with optional surrounding quotes?

How would one write a regex that matches a pattern that can contain quotes, but if it does, must have matching quotes at the beginning and end? "?(pattern)"? Will not work because it will allow patterns that begin with a quote but don't end with one. "(pattern)"|(pattern) Will work, but is repetitive. Is there a better way to do t...