melt-umn / silver

An attribute grammar-based programming language for composable language extensions
http://melt.cs.umn.edu/silver/
GNU Lesser General Public License v3.0
57 stars 7 forks source link

indexOf should return a Maybe, not -1 #780

Open remexre opened 1 year ago

remexre commented 1 year ago

silver:core:indexOf should probably return a Maybe to ensure that callers are handling the case where a substring isn't found correctly.

This could be a performance regression; ideally we'd have a (static) inliner and something that can do the case-of-case optimization... but that's of course not part of this ticket, just wontfix this if it measurably regresses performance.