• entries
    359
  • comments
    237
  • views
    188610

Tangent: Adverbs

Sign in to follow this  

154 views

It took a week of dirty dirty hacks, but I got that not example working from the last post. I'm sure I broke 2-3 things somewhere, and it runs like a dog, but it works. Oh, and it's far more ugly and verbose than I'd like. The final working test code:


public static generic(Exists P)
not( P infix -> bool predicate ) => P infix -> bool{

return(
(P arg) infix => bool{
return( not (predicate arg) );
}
);
}

public static main()=>void{
print (5 not equals 4);
}



Instead of defining equals and not equals we define not to take any binary predicate and modify it to be the inverse.

More work will be needed to make the generic referencing more robust, and some stuff to make the language more flexible about where generics can be used in declarations.

But this is the general idea behind some of the language features. Expressions behave more like linguistic expressions, where bits can be combined together, and modified in pieces rather than mathematical expressions which so poorly describe the problems faced by modern programmers.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now