Skip to content

Instantly share code, notes, and snippets.

@nikhedonia
Forked from njlr/hello-world.cpp
Last active February 22, 2017 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhedonia/8556d70359f3f7614d3aebf62b6ce72c to your computer and use it in GitHub Desktop.
Save nikhedonia/8556d70359f3f7614d3aebf62b6ce72c to your computer and use it in GitHub Desktop.
// Jyt is a REPL for C++
// You can write code interactively
// Highlight some code and press alt-enter to execute it
// For example:
auto x = "hello world";
// Now you can query the value in the terminal on the right
// e.g. "x"
// You can also update the value
// x = "hello again";
// The terminal on the right is meant for evaluating expressions.
// This window is on the otherhand for definitions. E.g.:
int foo(int x) {
return x;
}
// And you can include libraries
#include<iostream>
int main(std::string x) {
std::cout << x << " " << foo(42) << std::endl;
return 0;
}
auto result = main(x);
// Press the "play" button to load this file and interact in the terminal.
// As C++ does not allow to redefine symbols, pressing "play" multiple times might cause errors.
// You can restart the whole enviroment by pressing the "reload" button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment