part-cw / LNhealth

Health-related apps using the LambdaNative framework
http://lnhealth.lambdanative.org
Other
22 stars 3 forks source link

Color definition fails if in lambda statement #2

Closed karliwalti closed 6 years ago

karliwalti commented 6 years ago

When defining conditionals in sx files, the assignement of a color fails whereas outside of condition it works.

working:

(spacer)
(label color ,Yellow text  "email" align left)

fails:

(spacer)
 ,(lambda ()
 (if  #t    '(label color ,Yellow text  "email" align left)))

error message:

(bitwise-and ',Yellow 255): (Argument 1) Exact INTEGER expected [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/ln_glcore/glcore.scm line=104 col=20 [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/ln_glgui/primitives.scm line=198 col=3 [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/ln_glgui/glgui.scm line=151 col=36 [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/ln_glgui/glgui.scm line=145 col=11 [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/ln_glgui/glgui.scm line=183 col=3 [ERROR] 2017-11-29 09:12:18: trace: /lambdanative/modules/eventloop/eventloop.scm line=151 col=9 [ERROR] 2017-11-29 09:12:18: HALT

ddunsmuir commented 6 years ago

The correct punctuation for this that works is:

  ,(lambda ()
    (if  #t    `(label color ,Yellow text  "email" align left)))
mgorges commented 6 years ago

If the change is too subtle, it is the ` [backquote] before the "(label" list, which is used instead of the ' [quote].

karliwalti commented 6 years ago

Thank you, I got it working now and it solves many of my issues!