Coder Social home page Coder Social logo

lel's Introduction

Top Langs

lel's People

Contributors

dawikur avatar displaylink-dkurek avatar

Stargazers

 avatar

Watchers

 avatar

lel's Issues

Empty Base Optimization

Use EBO to reduce size of lambdas.
E.g.:

sizeof(_x) == 1;
sizeof(_x + 1) == sizeof (1);
sizeof(_x + 1 < 5) == sizeof (1) + sizeof(5);

sizeof(_y < _x) == 1;

Windows is not compiling

It looks like bug in VS. Apparently when deducing template parameters, when two packs resolves to the same one it crashes.

Updating more than one value

This is failing

auto update = ++_x < ++_y;

int x = 2;
int y = 8;

update(x, y);

ASSERT_EQ(3, x);
ASSERT_EQ(9, y);

It looks like somewhere one additional copy is made

Function call

One missing overload for placeholders is function call.

Currently operator() invokes the lambda

_x(5); // returns 5
(_x+1)(5); // return 5

But, it might be useful to make lambda which will use operator() inside, e.g.

auto call_with = _x(_y);

call_with(printf, "str");

But how to distinguish between placeholder and lambda?

For now there is no difference

_x <- lambda
_x + 1 <= lambda

It can be that

_x <- placeholder; operator() creates lambda
_x + 1 <- lambda, operator() invokes it

But what with

auto foo1 = _x;
auto foo2 = *_x;

It is lambda or placeholder?

void bar();

foo1(bar);
foo2(&bar);

Or maybe it can be distinguished on the base of class? bool template parameter.

Match

auto sign = match(_x)
  , _x <  1 = -1
  , _x == 0 =  0
  , _x  > 1 =  1
;

Method call

Somethig like this:

auto call = (_x->*_y)._(_1);
call(&obj, &Obj::Method, arg);

Curring

Allow curring, eg:

auto func3 = _1 + _2 + _3 + _4;
func3(1)(2)(3, 4);

Currying doesn't work with method call

It breaks calls because how we do currying:

(_x ->* _y)._(_z);

translates to

(_x ->* _y)(_z);

and currying looks gives us

(&object -> *_y)(_z);

which is not working. We have to detect if currying is
happening and 'un-rebind' it to

(&object -> *_y)._(_z);

Better messages when fail

If something will not compile - it is just soo hard to see what is happening.
This has to be improved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.