You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using macros serves some purpose (support for multiple types of arguments), however it has some problems: makes things difficult to debug, a bit overspecialized in some ways, too.
So, how about using lambda expressions (in addition to macros, or else replacing macros with template functions)?
For instance, instead of having specialized macros, you don't need variadic macros if the function itself is called using a lambda expression, and error handling could also be handled with lambdas. The compiler can inline these and eliminate dead code, and it should be much easier to debug.
Variadic macros still have limited toolchain support, and make debugging much harder, so it seems like it could be a good tradeoff
(I realize this is unrelated to the issue here, but same code area, wanted thoughts on it since it might harm toolchain support a bit. We still aren't using lambdas in v8)
Activity
vkurchatkin commentedon Dec 24, 2014
@piscisaureus is it still an issue? f6556b6 was supposed to fix that
[-]Review f16edd2632930e3fbfead4d6d52eeac87824f1a6[/-][+]Fix SYNC_CALL/SYNC_DEST_CALL in node_file.cc[/+]piscisaureus commentedon Dec 24, 2014
@vkurchatkin Yes, still an issue.
(A)SYNC_DEST_CALL is not supposed to be used for
symlink. That's because the first argument to symlink() isn't an actual path.caitp commentedon Jan 11, 2015
I was thinking:
Using macros serves some purpose (support for multiple types of arguments), however it has some problems: makes things difficult to debug, a bit overspecialized in some ways, too.
So, how about using lambda expressions (in addition to macros, or else replacing macros with template functions)?
For instance, instead of having specialized macros, you don't need variadic macros if the function itself is called using a lambda expression, and error handling could also be handled with lambdas. The compiler can inline these and eliminate dead code, and it should be much easier to debug.
Variadic macros still have limited toolchain support, and make debugging much harder, so it seems like it could be a good tradeoff
(I realize this is unrelated to the issue here, but same code area, wanted thoughts on it since it might harm toolchain support a bit. We still aren't using lambdas in v8)
indutny commentedon Jan 11, 2015
I'm +1 for template functions.
fs: improve error messages
Refcount for v8impl::Reference should be unsigned (nodejs#207)
Refcount for v8impl::Reference should be unsigned (nodejs#207)