Type information shouldn't need specifying unless something is being created, not on any part of being passed, for example like this.
func2(val)
{
int n = 2;
n += val;
return n;
}
not like this.
int func2(int val)
{
int n = 2;
n += val;
return n;
}
Any function should be able to be in any form, for example if the two functions exist + and PLUS then all these should be valid.
2 + 2
2.+(2)
+(2, 2)
(+, 2, 2)
2 PLUS 2
2.PLUS(2)
PLUS(2, 2)
(PLUS, 2, 2)
When creating something it should be a java like pointer to object, members should also seem separate like this.
obj a; // made a pointer called "a", members of "a" now appear to be pointer members and a few members that all objects get on creation
a.add_members(std::string); // gets all the default stuff from std::string
a = "apple";
a.add_members(std::string::spellcheck) // gets a specific thing not included as default from std::string
a.spelled_correctly() // this line returns a bool
a.remove_members("=", std::string::speellcheck)
a = "bcd"; // error
Because construction might have a few steps in many cases it could often occur in functions like so.
number(16, 2) // a 16 bit number with 2 decimal places
set("LL") // a set where each element can be anything stored as a linked list
internally, the function set("LL") could do something like this
obj a;
a.add_members(std::set);
switch (param("storege_type"),
("LL",
a.add_members(std::set::storage::linked_list)
)
Function shouldn't require brackets at the end if they are being given no parameters.
Also, lets think about quotes, the function.
a.spelled_correctly
could be
a."spelled correctly ?"
similarly here
2 "+" 2
2."+"(2)
"+"(2, 2)
("+", 2, 2)
However this is a bit verbose, it's helpful though if we want to pass the functions name around as a parameter to think of there names as being like a string.
A program that looks like this in C++
void func1()
{
this();
that();
other();
}
void func2()
{
std::cout<<"abc";
func1();
}
int main()
{
func1();
func2();
return 0;
}
could be better represented like this
obj func,
func1 = {this, that, other},
func2 = {std::cout<<"abc", func1},
// func2.unordered,
// func2.scope_behavior_global,
func1.run(),
func2.run_any_order(),
return 0
Using design created in this sort of way things could occur such as sets could be asked things using there members like "compare each of your contents that match these requirements against each other using this member and return to me this sort of information" using a fairly small fairly human readable function.


Sign In
Create Account

Back to top









