Say I have an API that takes a callback, and I have two functions, one for callbacks with arguments and one for nullary callbacks. I must do it this way. What naming choice would you use to distinguish the two variants? I feel like "nullary" is obscurantist
@mcc maybe "WithoutArgs"?
@mcc i'd be real tempted to call it "callbacks that don't receive arguments"
@mcc myfunc_args and myfunc_nullargs would be my first idea, in the absence of any style guide or existing convention.
@mcc I think it's more likely that you'll be able to add something described to the args version about what the args are for

@mcc "nullary" seems like the common term for it though?

https://en.wikipedia.org/wiki/Arity

but i guess "0-ary" could also work, since we have "n-ary"

Arity - Wikipedia

@mcc I'd probably name them _0, _1, _splat or something based on the signature but that's probably more obscurantist
@bob For a strange and application-specific reason, the only possible options are _0 and _1. This said, _0 and _1 *are* quite clear… hm
@mcc I seem to recall reactive framework had action=no argument call back and function or consumer for callback with arguments. They sometimes also just used generic func0 func1 func2 ... funcN interfaces

@mcc Mmm, maybe _with_ARGTYPE for the one that takes an arg-bearing callback?

I'm thinking of setting an event handler, as a concrete example. So, like,

setHandler( () => { ... } )
setHandlerWithEvent( (e) => { ... } )

@mcc with_none vs. with_some? with_none vs. with_more?
@mcc hopefully a name that communicates why it's 0-arity... myfunc_with_defaults()?
@mcc BlahProc and BlahFn?
@sgf Hm. What I like about this is even if someone has never seen this terminology before they'd probably figure it out just looking at the names.

@mcc in operating system kernels you often see system calls extended with additional arguments the original designers didn't anticipate. For example, the Unix wait() and waitpid() calls are usually implemented with something more baroque, like __wait4() or __wait6().

So I kinda like the simplicity of "callback0" and "callback1". It isn't elegant or clever, but it is obvious.