Beginner's question: why is this happening?

OK, maybe not. But what about List and Scheme (if you consider them major languages)?

Anyway, I guess I was deceived into thinking hyphens were OK because I didn’t get an error message.

Programming language trivia question – what do COBOL and LISP have in common? (Ans: both allow hyphens in variable names)

Technically, you did nothing wrong. There are a few “style” warnings, the most common being for singleton variables. There’s also check/0, which will look for other potential errors. But as far as I know, using “-” instead of “_” isn’t checked.

1 Like