Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

When returning a 'nil' value, the value handler is not called #144

Closed
hugoduncan opened this Issue · 5 comments

3 participants

@hugoduncan
Owner

When an nREPL message with :value nil is read, the value callback handler is not invoked.

Should the callback code be checking for the presence of the key, rather than it's value, or was this by design?

@kingtim
Owner

Hmm... I'm confused.

It does seem to be calling the value handler in that case, or perhaps I am misunderstanding.

; nREPL 0.1.5-preview
user> nil
nil
user> (print "hi")
hi
nil
user>

Which specific interaction are you using where it doesn't seem to be working right?

@hugoduncan
Owner

The eval task sends back strings, so the value the response handler sees is "nil".

I was working on the ritz codeq-def middeware, which returns a list of source definitions for display in a popup buffer. The middleware returns a (possibly empty) list, rather than the pr'd string. I'm debating now if that is a reasonable thing to do, but tend to think it is a valid use of the value, as it is something that bencode decodes properly.

@kingtim
Owner

Ah right, I knew those were coming back as strings but spaced it.
I agree, it should be valid, and this is a bug.

@kingtim
Owner

I pushed a branch called nil-value which should address this issue. Can you test it out when you get a chance and let me know if that works?

@bbatsov
Owner

I guess we can close this one? @hugoduncan @kingtim

@bbatsov bbatsov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.