Random Chitchat 2012-2016
Welcome back!
Yes, move it out Smile
Thanks given by:
(09-16-2015, 01:05 AM)Safwat Wrote: Hello everyone!
I'd like to resume working on AI.

Thats` great!
Thanks given by:
I just learn't about higher order macros in c++. Would anyone object if I made the broadcast functions use them to avoid writing 20 identical functions?
Thanks given by:
Could you elaborate a bit more on that? I'm not familiar with "higher order macros".
Thanks given by:
Its where you pass a macro as a macro parameter. Like higher-order functions but with macros.
For example:
Code:
#define Foo(a) a##b
#define Bar(a) a##c

#define Baz(X) X(y)

Baz(Foo) Baz(Bar)
This prepossesses to yb yc
Thanks given by:
Will it be maintainable? Wouldn't cBroadcastManager be a better solution, since it could be callable from Lua as well?
Thanks given by:
Maintainability is my main worry, but it gets rid of a lot typing. At the moment even with cBroadcastManager involves writing an identical function for each broadcast packet. With higher order macros, you can get writing those glue functions down to just a list of parameters and names.

Maybe a generator would be more maintainable, its just lua is not good at text.
Thanks given by:
Try to write one or two, and then let us see what it would be like. If it feels like magic, it'd be better to spell everything out explicitly, even if it means a few (thousand) extra keystrokes Smile
Thanks given by:
Anyone remebers gource?
I hope its not too fast now.Tongue
Thanks given by:
Its a bit too fast. Also, it needs a better way of determining attribution, as most of the main contributors appear as multiple people, often at the same time.

And Can anyone understand why cClientHandle::SendChat has such a complicated way of fetching cWorld: https://github.com/cuberite/cuberite/blo....cpp#L2092 ?
Thanks given by:




Users browsing this thread: 112 Guest(s)