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