nim-lang / fusion

Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches.
MIT License
128 stars 16 forks source link

Fix issue #43: `min` example for fusion/astdsl.nim is wrong #48

Closed slonik-az closed 3 years ago

slonik-az commented 3 years ago

Apparently, fixing #43 is easy. Using a sequence of straight if statements to find a min.

Code generated from min("d", "c", "b", "a") macro call now looks as follows:

var minResult_14505010 = "d"
if "c" < minResult_14505010:
  minResult_14505010 = "c"
if "b" < minResult_14505010:
  minResult_14505010 = "b"
if "a" < minResult_14505010:
  minResult_14505010 = "a"
minResult_14505010