juan_gandhi: (Default)
[personal profile] juan_gandhi
Tell me friends, is there a reasonable way to represent formulas (like logical conditions, for instance) in json format? Kind of... not obvious to me.

Date: 2010-02-17 02:35 am (UTC)
From: [identity profile] cema.livejournal.com
Only as functions, I think.

Date: 2010-02-17 03:31 am (UTC)
From: [identity profile] ygam.livejournal.com
{op:ge arg1:{op:plus arg1:1 arg2:{op:minus arg1:2 arg2:3}} arg2:0}

Date: 2010-02-17 03:46 am (UTC)
From: [identity profile] cema.livejournal.com
S-expression can be represented with curlies but is it still json?

Date: 2010-02-17 06:09 am (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
Beautiful! Thanks!

Date: 2010-02-17 05:22 am (UTC)
From: [identity profile] exceeder.livejournal.com
Why not pass it as a string? In JavaScript there is eval(). If JSON is just a transport, for sure there is a library to evaluate it in any language you are using.

Unless, of course, the formulas are real huge and have to be pulled in in pieces depending on calculation context. Hard to imagine these days. Whoever owns the full formula should to the folding anyways.

Date: 2010-02-17 06:10 am (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
Too much for certain mobile devices.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 23rd, 2025 05:19 pm
Powered by Dreamwidth Studios