Suggestions on syntax to express mathematical formula concisely

前端 未结 13 1109
予麋鹿
予麋鹿 2021-02-02 08:46

I am developing functional domain specific embedded language within C++ to translate formulas into working code as concisely and accurately as possible.

I posted a proto

相关标签:
13条回答
  • 2021-02-02 09:22

    I don't like the way you specify that "triangular" 2d range. I'd like to see something like:

    (i,j) in range(0..j,0..N)
    

    for example, which could then lead to:

    X = sum(f(i,j) for (i,j) in range(0..j,0..N));
    

    AFAIK This is not an existing language, but since you're creating your own syntax... I'm doubtful about the ability to use j in the range expression for i, but you found a way in yours :-)

    0 讨论(0)
提交回复
热议问题