Forums

DLLs, Namespaces and C# code

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

DLLs, Namespaces and C# code

Postby Charles » Sat Feb 09, 2008 12:26 pm

I received an email with these three questions, which I will answer here:

1) How can I have cobra generate a dll?

cobra -t:lib foo.cobra

2) Does cobra support namespaces?

Sure does:
use System.Net

namespace Cyberdyne.Skynet
class Data
var _foo # ...

3) Is there a way to preserve the generated C# code for education?

Yep. It's a command line option:
Code: Select all
cobra -c -keep-intermediate-files foo.cobra bar.cobra
cobra -c -kif foo.cobra bar.cobra

The files will be named "foo.cobra.cs" and "bar.cobra.cs". You only need one command. "-kif" is a synonym for "-keep...". Also, try out "cobra -h".

I've seen reports that Cobra programs are executing quite fast due to leveraging the C# compiler.
Charles
 
Posts: 2510
Location: Los Angeles, CA

Return to Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron