General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".


Postby Charles » Sat Jan 04, 2014 6:12 pm

I kicked off a new thread regarding the usage of Mono.Cecil in Cobra. This came up in another thread starting here:


nerdzero mentioned doing this in the IDE add-in, but I would think doing it in the compiler would make more sense so that the compiler and IDE were always in sync doing the same thing.

Here is a tiny Cobra sample:

Download nuget.exe and then:

nuget install Mono.Cecil
copy Mono.Cecil<TAB>\...\Mono.Cecil.dll .
cobra cecil.cobra

@help AssemblyDefinition
@help Module
@help TypeDefinition

use Mono.Cecil

class P

def main
name = 'Cobra.Core.dll'
ad = AssemblyDefinition.readAssembly(name)
trace ad,, ad.fullName
for mod in ad.modules
trace mod,
for type in mod.types
trace type,
print 'done.'

The more I think about it, the more convinced I am to go this route. System.Reflection has its problems and no one on the .NET team seems to be fixing them.

Plenty of projects have gone before us, so I think we'll be fine:

Any questions or concerns?
Posts: 2515
Location: Los Angeles, CA

Return to Discussion

Who is online

Users browsing this forum: No registered users and 6 guests