1

dose boo understand Expression tree?

I try to compile this line with sharp develop

exp as System.Linq.Expressions.Expression[of Func[of SomeClass, bool]] = { p as Text | return (p.Name == 'tttt') } 

but sharp develop raised this error

Cannot convert 'callable(testlinq.SomeClass) as bool' to 'System.Linq.Expressions.Expression[of System.Func[of testlinq.SomeClass, bool]]'. (BCE0022) 
tripleee
  • 175,061
  • 34
  • 275
  • 318

1 Answers1

1

Boo has had expression trees longer than C#.

http://ayende.com/blog/3065/meta-methods

[Meta]
static def verify(expr as Expression):
    return [|
        unless $expr:
            raise $(expr.ToCodeString())
    |]

IIRC Boo was designed to allow meta-programming macro's (much like Lisp, Nemerle, and many other functional languages) and has as such allowed full access to the AST of any fragment of Boo code.

Now this is all served from long memory, so I advise you to consult the Boo documentation for up-to-date information.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Thanks but I mean lambda expression tree not AST –  Aug 10 '11 at 07:52
  • A lambda expression tree is rather ambiguous; I guess you mean `System.Linq.Expressions.Expression`; If I'm not wrong the example page linked shows you exactly how to interoperate with that, but I might have been reading that wrong? – sehe Aug 10 '11 at 08:57