f# - Is it possible to differentiate between typed and untyped nested quotations? -


for example, given <@ let x = <@ 1 @> in x @> , <@ let x = <@@ 1 @@> in x @>, can match both patterns.let(_, (patterns.quote(_) q), _) -> q can't differentiate between typed , untyped q.

interesting. seems quotations stored in typed form.

the type of <@@ 1 @@> sub-expression inside quotation expr<int>. however, type of variable x differs in 2 quotations:

match q1 | patterns.let(v, (patterns.quote(_) q), _) when v.type = typeof<expr> -> "untyped" | patterns.let(_, (patterns.quote(_) q), _) -> "typed" | _ -> "other" 

but i'm not sure how use differentiate between 2 cases in general. seems can if @ context (and there many possible context...)


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -