This file contains hidden or 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
| #![feature(io)] | |
| use std::net::{TcpStream}; | |
| use std::io::{BufRead, BufReader, Write, stdout}; | |
| //mod parser; | |
| fn main() { | |
| let name = "irc.freenode.net:6667"; |
This file contains hidden or 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
| struct Foo<'a> { | |
| a: String, | |
| b: &'a str, | |
| } | |
| impl<'a> Foo<'a> { | |
| fn new() -> Foo<'a> { | |
| Foo { a: String::new(), b: "" } | |
| } | |
This file contains hidden or 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
| getAppend :: String -> IO String | |
| getAppend x = getLine >>= return . (++ x) | |
| main :: IO () | |
| main = getAppend " World!" >>= putStrLn |
This file contains hidden or 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
| class Color(prefix: String) { | |
| def apply(text: String): String = { | |
| prefix + text | |
| } | |
| } | |
| object Color { | |
| val RED = new Color("&c") | |
| val BLUE = new Color("&1") |
This file contains hidden or 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
| import java.net._ | |
| import java.io._ | |
| import scala.io._ | |
| class IRC(server: String, nick: String, user: String, channel: String) { | |
| val port = 6667 | |
| val host = InetAddress.getByName(server) | |
| val sock = new Socket(host, port) | |
| lazy val in = new BufferedSource(sock.getInputStream()) | |
| val out = new PrintStream(sock.getOutputStream()) |
This file contains hidden or 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
| import java.io.PrintWriter | |
| import java.net.{InetAddress, Socket} | |
| import scala.io.BufferedSource | |
| object Main { | |
| def main(args: Array[String]) = { | |
| val conn = new Socket( | |
| InetAddress.getByName("irc.openredstone.org"), | |
| 6667 |
This file contains hidden or 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
| trait AstElem[+T] { | |
| def eval(): T | |
| } | |
| class LispFunction[-T, +R](f: List[T] => R) { | |
| def apply(l: List[AstElem[T]]): R = { | |
| f(l.map(_.eval())) | |
| } | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| // "errors" | |
| "fmt" | |
| ) | |
| type Stack []int | |
| func (s *Stack) Put(elem int) { |
This file contains hidden or 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
| module Lib where | |
| import Network | |
| import Data.List | |
| import System.IO | |
| import Control.Arrow | |
| import Control.Monad.Reader | |
| import Control.Exception | |
| import Text.Printf |
This file contains hidden or 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
| #include <stdio.h> | |
| #define string int | |
| #define begin { | |
| #define end } | |
| #define return(x) printf("%s", x); return 0; | |
| string main(int argc, char **argv) | |
| begin |
OlderNewer