-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumber.cpp
More file actions
39 lines (33 loc) · 769 Bytes
/
number.cpp
File metadata and controls
39 lines (33 loc) · 769 Bytes
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
32
33
34
35
36
37
38
39
#include "number.h"
#include "stream.h"
#include "closure.h"
Stream *Number::execute(Object *in)
{
Stream *res = new Stream();
if (in == Number::ArgPlus)
{
// Return a function that accepts another number and outputs the sum.
}
else if (in == Number::ArgMinus)
{
}
else if (in == Number::ArgMul)
{
}
else if (in == Number::ArgDiv)
{
}
else if (in == Number::ArgMod)
{
}
return res;
}
std::string Number::to_string()
{
return std::to_string(value);
}
const Object *Number::ArgPlus = new Closure();
const Object *Number::ArgMinus = new Closure();
const Object *Number::ArgMul = new Closure();
const Object *Number::ArgDiv = new Closure();
const Object *Number::ArgMod = new Closure();