kiselgra / c-mera

Next-level syntax for C-like languages :)
Other
403 stars 17 forks source link

Names defined in CL overwrite user-functions #74

Open kiselgra opened 7 years ago

kiselgra commented 7 years ago

In the following example

(function replace (...) -> ...
    ...)

....
(function foo (...) ...
    (replace ...))

replace maps to the symbol from CL, not the function defined above.

I suppose this is tricky as the Quoty check for macros is based on this behaviour ( @lispbub right?) but this behaviour will be very surprising (and the error message is not really helpful) for new users...

lispbub commented 7 years ago

I could add a check/warning if an existing lisp function is used in a function definition: (fuction replace ..

kiselgra commented 6 years ago

I think issuing a warning would be best thing to do. Changing the mapping of the name would probably lead to chaos :)

kiselgra commented 6 years ago

One thing, though, users will have to be aware anyhow, will they? E.g. there are functions that overlap via the standard libraries alreads, e.g., sin et al.

But we can't just issue a warning as such a function call might actually be intended. Still a big issue for the manual.

Maybe we can build a list of duplicate names by checking header files and the CLHS.