-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ER: debug/1 #2709
Labels
Comments
pkoppstein
added a commit
to pkoppstein/jq
that referenced
this issue
Jul 13, 2023
This def ensures the output of debug(m1,m2) is kept together. See jqlang#2709 jqlang#2111 jqlang#2112
Merged
pkoppstein
added a commit
to pkoppstein/jq
that referenced
this issue
Jul 13, 2023
This def ensures the output of debug(m1,m2) is kept together. See jqlang#2709 jqlang#2111 jqlang#2112 Update jq.1.prebuilt manual.yml: debug/1: more typos manual.yml: debug/1: typo msgs
pkoppstein
added a commit
to pkoppstein/jq
that referenced
this issue
Jul 13, 2023
This def ensures the output of debug(m1,m2) is kept together. See jqlang#2709 jqlang#2111 jqlang#2112 Update jq.1.prebuilt manual.yml: debug/1: more typos manual.yml: debug/1: typo msgs builtin.jq: spacing
pkoppstein
added a commit
to pkoppstein/jq
that referenced
this issue
Jul 13, 2023
This def ensures the output of debug(m1,m2) is kept together. See jqlang#2709 jqlang#2111 jqlang#2112 Update jq.1.prebuilt manual.yml: debug/1: more typos manual.yml: debug/1: typo msgs builtin.jq: spacing manual.yml: more tweaking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There have been several proposals for adding debug/1 for convenience.
In particular, @nicowilliams mentioned:
This has good memory-management characteristics, but includes "(.)" unconditionally, which reduces flexibility and can lead to very long
debug
messages that can potentially cause problems. Thus I would like to propose a similar but simpler definition:This would allow tailored messages such as:
debug("entering foo(\(arg1); \(arg2))")
while still allowing . to be prepended with a string, at a cost of just a few extra keystrokes:
Or one could go with:
Footnote:
#2112 proposes:
but this def effectively presupposes that f is a singleton, for if
one were to use it and wrote
debug("msg1"; "msg2")
, an undesirable fork would result.The two defs above avoid this issue, and indeed make it easy to split up a debug message over more than one line, while keeping them together.
The text was updated successfully, but these errors were encountered: