« first day (550 days earlier)      last day (714 days later) » 

2:57 AM
@Dennis am I correct that does not work in niladic chains?
Because, the first nilad is supposed to be the argument to the ensuing monad
 
Does not work implies that there is an expected behavior, which in turn would require some kind of spec...
@EriktheOutgolfer Looks good, yeah. I seem to have missed the ping. Sorry about that.
 
> To evaluate a niladic chain that starts with a nilad, like α F G H, evaluate the monadic chain F G H at that nilad α.
So wouldn't refer to α? @Dennis
(Although it would also be useful to have refer to [] here)
 
@LeakyNun Well, that's a tutorial, not a spec. It was written long after was implemented...
 
@Dennis I see, thanks.
For an inconsistent behaviour, consider 4+, which returns 8. @Dennis
 
That's not inconsistent.
simply doesn't refer to the argument in a niladic chain.
 
3:10 AM
then what is the right argument of + in 4+?
 
12 messages moved from The Nineteenth Byte
 
def niladic_chain(chain):
	while len(chain) == 1 and hasattr(chain[0], 'chain'):
		chain = chain[0].chain
	if not chain or chain[0].arity > 0:
		return monadic_chain(chain, 0)
	return monadic_chain(chain[1:], chain[0].call())
 
@LeakyNun The argument of the chain, which becomes 4. is simply something else.
 
def variadic_chain(chain, args):
	args = list(filter(None.__ne__, args))
	if len(args) == 0:
		return niladic_chain(chain)
	if len(args) == 1:
		larg_save = atoms['⁸'].call
		atoms['⁸'].call = lambda literal = args[0]: literal
		ret = monadic_chain(chain, args[0])
		atoms['⁸'].call = larg_save
@Dennis The root is in here, line 996 onwards.
 
There is no problem. It works as designed.
 
3:12 AM
That is set to the left argument in a monadic chain, yet not in the niladic chain.
 
Yes, exactly. and refer to arguments that were actively passed to the link.
 
 
4 hours later…
7:03 AM
Being that Jelly atoms and quicks always mean the same (as opposed to J's primitives), wouldn't it be fairly easy to write a program which outputs a legend (in order of occurrence) for inclusion with posts? It can then be tweaked by hand (e.g. indented to show structure).
 
 
10 hours later…
4:54 PM
Why does ⁼“foo”ȯµ⁼“bar” output 0 for input foo?
 
@Doorknob µ starts a new chain that will be executed after the first one. Are you trying to test if the string is either foo or bar?
If so, ⁼“foo”ȯ⁼“bar”$ would work. $ groups two (or more) links to the left into a monadic chain.
That said, e“foo“bar would be a lot shorter.
 
5:27 PM
@Dennis Yes, but that was just an example. I'm just trying to find a way to shorten [complex monad]\n[complex monad]ȯÇ (where both monads are too long to be grouped with $).
 
@Doorknob If you can make one of the monads a dyad without penalty, ⁼“bar”ɓ⁼“foo”ȯ works.
 
Neat, thanks!
 

« first day (550 days earlier)      last day (714 days later) »