Playing with VBnext (Roslyn) features.
Select Case Type Of
This make the already powerful Select Case statement, even more powerful.
Now you can us like in more of match exp with expression of Nemerle and F#.
Nemerle-esque code
Select Case Type Of
This make the already powerful Select Case statement, even more powerful.
Now you can us like in more of match exp with expression of Nemerle and F#.
Public Function Nod(n As SyntaxNode) As SyntaxNode Select Case n Case op As OperatorNode Select Case op Case op1 As UnaryOperator When TypeOf op1 Is ILHS ' Postfix Operator Case op1 As UnaryOperator When TypeOf op1 Is IRHS ' Prefix Operator Case op2 As BinaryOperator Case op3 As TrianyOperator Case Else End Select Case Else End Select End Function Interface ILHS ReadOnly Property LHS As SyntaxNode End Interface Interface IRHS ReadOnly Property RHS As SyntaxNode End Interface MustInherit Class SyntaxNode End Class MustInherit Class OperatorNode Inherits SyntaxNode End Class MustInherit Class UnaryOperator Inherits OperatorNode End Class MustInherit Class BinaryOperator Inherits OperatorNode End Class MustInherit Class TrianyOperator Inherits OperatorNode End Class
Nemerle-esque code
match n with { | op : Operator => { match op with { | op1 : UniaryOperator When op1 : ILHS => /* Postfix */ | op1 : UniaryOperator When op1 : IRHS => /* Prefix */ | op2 : BinaryOperator => | op3 : TrianyOperator => | _ => throw UnknownKindOfOperator } } | _ => throw UnknownNodeType }
0 Comments On This Entry
Search My Blog
Recent Entries
Recent Comments
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
← April 2018 →
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- .net
- .net4
- bf
- brainfuck
- Codeplex
- Coding
- custom Control
- custom controls
- DIC CodeAID VS Gallery
- Dice
- Die
- DLL
- Englishify
- Extension
- Extension Method
- ExtMethods
- F#
- Functional
- Functional Programming
- Graph
- Graphs
- Language Intergrated Query.
- Library
- LINQ
- LINQ Codes
- LISP interpreter
- Macro
- My Games
- Nemerle.
- net
- podcast
- Project
- Project Cider
- RadixSort Generics (Of T)
- restricted textbox
- Rolling
- rss
- rss feed
- Scribblings
- shadowtext
- Tips
- Transparent Textbox
- vb
- vb.net
- VB.net +LINQ Extension Method
- vb.net 1-Liners
- vb.net visual basic vs2010 .net4
- vs2010
- Weird
- XM
- xml
- XML Literals