console.log() for every language.
MIT License
console.log()
For when you don't want to think about what language you're using, and just get stuff onto the screen.
arr = [21, -22, [23, 24], "owl", {"eagle": [25]}]
map = {"cat": [31, 32], "dog": 33, 34: "fox"}
console.log("Values:", 1337, arr, map)
Language | Hackiness | Import | Arrays | Maps | Limitations |
---|---|---|---|---|---|
C++ | 🔥🔥 | #include "cpp/console.h" |
std::vector |
std::map |
¹ |
Go | 🔥 | import "./go/console" |
✅ | ✅ | ¹ ² |
Java | 🔥🔥 | import console.console; |
✅ | TODO | ¹ ³ |
JavaScript | N/A | ✅ | ✅ | ||
Julia | include("julia/console.jl") |
✅ | ✅ | ||
Mathematica | 🔥🔥🔥 | Import["mathematica/console.m"] |
✅ | ✅ | ⁴ |
Python | import console |
✅ | ✅ | ³ | |
Ruby | 🔥 | require "./ruby/console" |
✅ | ✅ |
console.Log
requires a capital L
in Go.console.log()
with parentheses only accepts a single argument; console.log[]
with braces is required for more. (Also, associative arrays break printing on the commandline in Mathematica 10. Old-fashioned lists of Rule
s still work, though.)If you know workarounds for these limitations (however hacky!), let me know.
console.log()
call in lowercaseconsole.log()
, inc. at the least the following types:
toString()
implementation)stdout
inline, with a space separator and a trailing newline
make test