[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] ob-csharp
From: |
thomas |
Subject: |
[O] ob-csharp |
Date: |
Mon, 07 Sep 2015 19:23:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 |
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
ob-csharp.el
Description: Text Data