Xalgorithms / general-examples

A repository used for rule package examples. May eventually contain core rules.
Apache License 2.0
1 stars 2 forks source link

Do we need/prefer quotation marks in Xalgo rules? #10

Closed jpotvin closed 6 years ago

jpotvin commented 6 years ago

I see that Ryan placed quote marks around each of the elements in the Singapore sample rule -- well, he was at least making it consistent: https://github.com/Xalgorithms/lib-rules-int-scala/commit/fa9b5aed0396234882ccb7eaeb8bf04e66bdbf31#diff-5ef2197027eadebb9d0f9655d7a05937

A question for both of you:

Given that XalgoAuthor currently requires the quote marks, well, should it by design? Are they there because it was a default syntax, or because they add info to a Xalgo expression?

If the quote marks don't add info, is it easy enough, and reasonable, to tweak XalgoAuthor to not require them?

To my mind, keeping Xalgo free from such requirements helps to minimize the syntax error rate amongst authors. But maybe removing them creates other problems.

karfai commented 6 years ago

No, we don't. The original file was invalid JSON. The quotes are required in the table expressions JSON.

jpotvin commented 6 years ago

RE: No, we don't. The original file was invalid JSON. The quotes are required in the table expressions JSON.

That confused me: "No, we don't.... The quotes are required"

Joseph Potvin Executive Director, Xalgorithms Foundation Mobile: 819-593-5983 jpotvin@xalgorithms.org https://www.xalgorithms.org

On Mon, Jul 2, 2018 at 4:16 PM, Don Kelly notifications@github.com wrote:

No, we don't. The original file was invalid JSON. The quotes are required in the table expressions JSON.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Xalgorithms/general-examples/issues/10#issuecomment-401920835, or mute the thread https://github.com/notifications/unsubscribe-auth/AFjWtY0cwzUSNSIMOLseXWdmQvIY5yr-ks5uCn-agaJpZM4U_jzJ .

karfai commented 6 years ago

So... There's nothing wrong with the Xalgo that @RyanFleck posted previously. Therefore, there is no discussion required about quotes in that part of the rule expression. But, his previous table additions for this test run were invalid JSON (we express tables in JSON when we upload them to GitHub). The changes he made were a correction to that invalid JSON. JSON key-value sets (objects) must have quoted strings as the keys. The values must be strings, numbers or booleans (thus the error message he saw). Free variables (which is what the unquoted strings would be in JS, not JSON) are not permitted in the format.

jpotvin commented 6 years ago

I'll await the weekly call for further clarification (i.e. the discussion required is just to clear up some minor confusion in my cranium).

Joseph

On Tue, Jul 3, 2018 at 2:00 AM, Don Kelly notifications@github.com wrote:

So... There's nothing wrong with the Xalgo that @RyanFleck https://github.com/RyanFleck posted previously. Therefore, there is no discussion required about quotes in that part of the rule expression. But, his previous table additions for this test run were invalid JSON (we express tables in JSON when we upload them to GitHub). The changes he made were a correction to that invalid JSON. JSON key-value sets (objects) must have quoted strings as the keys. The values must be strings, numbers or booleans (thus the error message he saw). Free variables (which is what the unquoted strings would be in JS, not JSON) are not permitted in the format.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Xalgorithms/general-examples/issues/10#issuecomment-402022408, or mute the thread https://github.com/notifications/unsubscribe-auth/AFjWtdSvkGv4AW2YtDwOgtoVUbr8KgyJks5uCwiSgaJpZM4U_jzJ .