-
Notifications
You must be signed in to change notification settings - Fork 0
/
builtins.hpp
31 lines (19 loc) · 946 Bytes
/
builtins.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MONKEY_PLUSPLUS_BUILTINS_HPP
#define MONKEY_PLUSPLUS_BUILTINS_HPP
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include "object.hpp"
// Store all defined builtin function names in an array to fix index ordering
extern std::array<std::string, 6> builtins_names;
std::shared_ptr<Object> __len(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Object> __first(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Object> __last(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Object> __rest(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Object> __push(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Object> __puts(std::vector<std::shared_ptr<Object>> args);
std::shared_ptr<Builtin> get_builtin_by_name(const std::string &name);
std::shared_ptr<Builtin> get_builtin_by_index(int index);
#endif //MONKEY_PLUSPLUS_BUILTINS_HPP