#Hello World in various programming languages
##Listed
- C
- C++
- D
- Ruby
- TypeScript
- F#
- Haskell
#Hello World in various programming languages
##Listed
| module tinyBase64Decoder | |
| open System | |
| open System.Collections.Generic | |
| // Declare fundamental functions | |
| // Convert binary string into decimal | |
| let binToDec binStr = Convert.ToInt32 (binStr, 2) | |
| // Convert decimal into binary string |
| #include <iostream> | |
| #include <functional> | |
| template <typename R, typename... Args> | |
| std::function<R(Args...)> Z(std::function<R(std::function<R(Args...)>, Args...)> f) { | |
| return [&](const Args&... args) { return f(Z(f), args...); }; | |
| } | |
| int main(int argc, char const* argv[]) { | |
| std::cout << |
| function isFunction(obj: any): boolean { | |
| return typeof(obj) == "function"; | |
| } | |
| function curry(func: any) { | |
| if (!isFunction(func)) { | |
| console.log("Fatal Error. An invalid value was given. It was not a function"); | |
| return; | |
| } |
| import std.conv; | |
| enum JSONNodeValueType { | |
| Numeric, | |
| String, | |
| Boolean, | |
| Array, | |
| NULL, | |
| JSONObject | |
| } |
| import std.stdio; | |
| struct ChunkHead { | |
| char[4] id; | |
| uint size; | |
| } | |
| struct RiffChunk { | |
| ChunkHead head; | |
| char[4] format; |
| #include <stdio.h> | |
| #define offsetof(type, member) ((size_t)&((type*)0)->member) | |
| #define container_of(ptr, type, member) ({ \ | |
| const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |
| (type *)( (char *)__mptr - offsetof(type,member) );}) | |
| typedef struct { | |
| int val1; |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define container_of(ptr, type, member) ({ \ | |
| const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |
| (type *)( (char *)__mptr - offsetof(type,member) );}) | |
| #ifdef __compiler_offsetof | |
| #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | |
| #else |
Note: Currently, LINE bot API is TRIAL, limited to the first 10,000 developers.
| class BASE {} | |
| class A : BASE {} | |
| BASE f(A a) {return a;} | |
| void main() { | |
| BASE b = new BASE; | |
| A a = new A; | |
| assert (typeid(b) == typeid(typeof(b))); // pass | |
| assert (typeid(a) == typeid(typeof(a))); // pass |