search for: is_var_arg

Displaying 4 results from an estimated 4 matches for "is_var_arg".

2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
...: unit -> llfunction t (* typesafe *) value_name (make_constant ());; value_name (make_global_variable ());; value_name (make_function ());; is_null (make_constant ());; is_declaration (make_global_variable ());; is_declaration (make_function ());; is_global_constant (make_global_variable ());; is_var_arg (make_function ());; (* type errors *) is_null (make_global_variable ());; is_null (make_function ());; is_declaration (make_constant ());; is_global_constant (make_constant ());; is_var_arg (make_constant ());; is_var_arg (make_global_variable ());; Bottom up. The advantage of this one is that...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick, On 2008-03-15, at 04:03, Erick Tryzelaar wrote: > I was talking to Gordon on #llvm earlier, and he challenged me with > coming up with a way to improve the ocaml binding's type safety. I > think I got an easy solution with phantom types. This could be a good step. I'm not sure I can predict all of the implications; I'd suggest you work up a proof of concept.
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
...iable ] > type llfunction = [ llglobalvalue | `Function ] > > val value_name : [> `Value] t -> string > val is_null : [> `Constant] t -> bool > val is_declaration : [> `GlobalValue] t -> bool > val is_global_constant : [> `GlobalVariable] t -> bool > val is_var_arg : [> `Function] t -> bool Ah, I get it now. type b = [ a | `B ] is idiomatic type theoretician for b t is a subclass of a t. This seems slightly a hack, using sum types to do exactly the opposite of what they're designed for. :) I think you want to use the sum types for parameter t...