breck7 / scrollsdk

Build on top of Scroll.
https://sdk.scroll.pub
379 stars 17 forks source link

Feature: key value pair with value in quotation #165

Closed ghost closed 1 year ago

ghost commented 1 year ago

It would be really helpful if providing values from key value pair can be within quotation marks (single quotes or double quotes or both preferably) so that things like array declaration for keys with multiple values can be easily done.

I counldnt find any reference material about the issue. Sorry if it is already supported.

breck7 commented 1 year ago

We don't support this. I haven't found a case where we've needed to use quotations (always I've found a better way). But there could be one! Closing for now but if you have an example please reopen.

ghost commented 1 year ago

@breck7 :

If i have multi value key called corpNames and its value is AT and T or bell labs and velco corp, it would be incorrectly parsed because the multi value keys are "AT and T " or "bell labs" and velcro corp.

It might not seem like a big deal but in Europe only a century or so ago it was common for company names to family name and sons or family name and brothers

smith and sons or smith and brothers.

breck7 commented 1 year ago

Great example @SRS-WRKS ! Thanks! So the " and " delimiter doesn't work for company names. How about " && " delimited: "AT and T && Bells Labs"

ghost commented 1 year ago

@breck7 : Thank you for the quick reply. && or || both included could give more flexibility (support for both logical and or logical or). If that is included in any way possible, this issue would have served its purpose.

breck7 commented 1 year ago

@SRS-WRKS I made this change across all originCommunities. I didn't realize this issue was in jtree. My mistake! The relevant commits are here: https://github.com/breck7/pldb/pull/165

breck7 commented 1 year ago

So for science, my theory still stands: there is never a need for quotations. Instead, just use an appropriate delimiter that would not appear in any list item.