builtins.cpp 537 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. My attempt at defining all builtin methods and functions as specified in
  3. the Malio language documentations.
  4. This may not be the best way to do it, but is my take to study C++
  5. */
  6. #include <iostream>
  7. #include <string>
  8. #include <fstream>
  9. #include "builtins.h"
  10. namespace malio {
  11. void print(std::string arg)
  12. {
  13. std::cout << arg << std::endl;
  14. }
  15. void writef(std::string content, std::string filename)
  16. {
  17. std::ofstream file(filename);
  18. file << content;
  19. file << std::endl;
  20. file.close();
  21. }
  22. } // namespace malio