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: string
}
let (neighbor: person seq) =
db.Yield <@ Seq.filter (fun p -> p.homeAddress.zip = '60614') @>
the obvious (and silly) question is... how do i parametrize the quotation? if i just somehting like
let z = "60614"
let (neighbor: person seq) =
db.Yield <@ Seq.filter (fun p -> p.homeAddress.zip = z) @>
then z gets resolved into a static property accessor (PropertyGet(None, String z, [])
). I need something that will let me retrieve the value of the variable/let binding based solely on the quotation. idears?