New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some User Defined Functions are Able to Overwrite Predefined Ones #242

Open
olimaticer opened this Issue Jul 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@olimaticer
Contributor

olimaticer commented Jul 20, 2017

EXAMPLE

!#Overwrites
FN.DEF BACKGROUND()
 PRINT "In Function Background()"
 !FN.RTN 8
FN.END
!#Overwrites
FN.DEF SIN(a)
 PRINT "In Function Sin(";a;")"
 FN.RTN a+4
FN.END
!!b
!Do not overwrite
FN.DEF APP.START()
 PRINT "In Function APP.START()"
FN.END
!!e
CALL BACKGROUND()
s = sin (0.707)
? s
! CALL APP.START()
DO
UNTIL 0
END

Gregor

@jMarcS

This comment has been minimized.

Collaborator

jMarcS commented Jul 20, 2017

The operative word being "some". This was discussed in the forum, I think it was two years ago.

The problem is that BASIC! is not consistent. The numeric expression parser and the string expression parser are quite different. By accident, one of them checks for user function names before built-in function names, and the other checks built-in functions before user functions.

In my opinion, users should be able to override the built-ins, but I don't feel strongly about it one way or the other. What I feel strongly about is that BASIC! should be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment