Last active
August 29, 2015 13:57
-
-
Save jtickle/9419951 to your computer and use it in GitHub Desktop.
Compilable and Interpretable GFM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello Class | |
This class exposes an interface "sayHello" that says hello. | |
If someone wrote a utility called 'gfmc', it would be a compiler that compiles whatever you put in code blocks in whatever language you specified and puts them in sensible places. | |
I don't think this is actually possible but you get the idea. It may not have any value at all, but then again it might if you want to make an API to your thing in every language anyone's ever heard of. | |
```php | |
class Hello { | |
public function sayHello() { | |
echo "Hello!\n"; | |
} | |
} | |
``` | |
```python | |
class Hello: | |
def sayHello(self): | |
print 'Hello!' | |
``` | |
```ruby | |
class Hello | |
def sayHello | |
print "Hello!" | |
``` | |
```java | |
public class Hello { | |
public void sayHello() { | |
System.out.println("Hello!"); | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment