varjo icon indicating copy to clipboard operation
varjo copied to clipboard

If an external function clashes with a function in global env should it replace it?

Open cbaggers opened this issue 7 years ago • 0 comments

The following code foo is defined but the existing func from global is still used (returning a foo-g object)

(add-external-function 'foo '() '()
                       '(1))

(defun test2 ()
  (glsl-code
   (translate
    (create-stage
     :vertex :450
     :code '((let ((x (foo)))
               (+ x 10)
               (vec4 1)))))))
Varjo: There is no applicable method for the glsl function '+'
when called with argument types:
(FOO :INT32)

Form: (+ X 10)
   [Condition of type VARJO-CONDITIONS:NO-VALID-FUNCTION]

This issues hits on some deeper issues for example, what if its a function from the glsl spec? Amybe in that specific case we should not allow replacement, simply because it fucks things up for other users

cbaggers avatar May 27 '18 14:05 cbaggers