AppliedLogicSystems / ALSProlog

ALS Prolog Compiler & Development Environment
https://alsprolog.com
MIT License
16 stars 9 forks source link

Remove $strlen, in favor of atom_length #162

Closed chuckhoupt closed 5 years ago

chuckhoupt commented 5 years ago

See commits for reasons in favor of deprecation/removal. Major question for review:

kenbowen commented 5 years ago

See commits for reasons in favor of deprecation/removal. Major question for review:

  • Is backward compatibility needed? The current PR completely eliminates $strlen within ALS Prolog. Are there large bodies of external code that rely on $strlen, that require a compatibility shim?

Not to my knowledge. I checked my own old code, and only found a few occurrences, which can easily be changed. Since atom_length appears in sec816.pro of the iso standard test suite, it has been present in the standard since the 90's. Note that in bparser.c, pbi_strlen is merely a wrapper around the C strlen, and the comment for atom_length says this: Note: This is our first trial of our new error handling mechanism for C-defined builtins. I think it is safe to completely remove $strlen.