Hi,
could not find ob-csharp in org mode. I created one to make the pointy
haired boss happy.
It's based on Eric's ob-java.el with some bits taken from other ob files.
It works for the simple examples following below.
Hope this is useful and I'm open for hints to improve the code.
- thomas
* ob-csharp Tests
** Hello World
#+BEGIN_SRC csharp
class HelloWorld {
public static void Main()
{
System.Console.WriteLine("Hello World!");
}
}
#+END_SRC
#+RESULTS:
: Hello World!
** Tables
#+BEGIN_SRC csharp
class Table {
public static void Main()
{
for (char c = 'a'; c < 'd'; c++)
System.Console.Write("{0} ",c);
System.Console.WriteLine();
for (int i = 0; i < 3; i++)
System.Console.Write("{0} ",i);
}
}
#+END_SRC
#+RESULTS:
| a | b | c |
| 0 | 1 | 2 |
** Compiler flags and command line args
#+BEGIN_SRC csharp :cmpflag -warnaserror+
public class TestFlags {
public static void Main()
{
int i; // unused; throw error
System.Console.WriteLine("You won't see this!");
}
}
#+END_SRC
#+RESULTS:
#+BEGIN_SRC csharp :results verbatim :cmdline --version
public class TestCmd {
public static void Main()
{
System.Console.WriteLine("You won't see this!");
}
}
#+END_SRC
#+RESULTS:
#+begin_example
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-10)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors.
www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
#+end_example