quil
quil copied to clipboard
Allow single-quoted strings for PRAGMA
In Quil-T we make use of PRAGMA FILTER-NODE
which expects a json-like string object. For example
PRAGMA FILTER-NODE raw "{'key': 'value', ...}"
The problem is, however, single-quoted strings are not valid JSON, so the above would have to be written
PRAGMA FILTER-NODE raw "{\"key\": \"value\", ...}"
which is awkward and error-prone when writing by-hand.
If we supported using single quotes for the pragma freeform string then the above would become
PRAGMA FILTER-NODE raw '{"key": "value", ...}'
@stylewarning WDYT?
Discussion from Quil call:
- Robert: Is
\
enough of a nuisance? Mark: Yes, it has been. - Robert:
'
would be nice to reserve for future use; - Erik: could possibly use
"""
or heredoc or so instead - Robert, Erik: Multi-line pragmas might be useful
can we use """
for docstrings too? 👼🏽
Bumping this issue. We'd also like to write JSON into DEFFRAME HARDWARE-OBJECT
and have it look nice. The backslashes are a bit of a bummer in that case.
In fact, would it unreasonable for Quil to have a designator for a JSON string? I feel like we're bumping into genuine contention between Quil and JSON (and potentially other formats) over the "
character. Given the description,
HARDWARE-OBJECT is a string indicating the (implementation-specific) hardware object that the frame is associated with.
it seems reasonable to support structured strings describing objects here.