12:33:36jmercourishow would one do something like an enum in Lisp?
12:33:57jmercourisI was thinking about just making a plist
12:34:42jmercourisI saw this stack overflow answer: https://stackoverflow.com/questions/578290/common-lisp-equivalent-to-c-enums
12:35:11jmercourisI might just make a function instead though, that makes sense to me
12:36:35jmercourisis a function call significant overhead as compared to simply having a constant?
12:37:12jmercourisI ask because I'm hesitant to use a constant, as the implmentation may change, that data may end up being stored in a database rather than in a configuration file, or in the source code
12:41:14phoejmercouris: you could define a pure function that accepts an argument and returns constant numbers
12:41:21LdBethjmercouris: what do you want to do with enum? I think most of the time plain symbols just work
12:41:23Bikenot that a function call is THAT expensive. but it will be more expensive. given that the operation of the function will be to look up a constant?
12:43:07phoeif you then need to change the implementation, declare the function notinline, recompile your whole codebase, replace the function body with something that e.g. fetches data from database and returns the same numbers
12:43:32phoethat will obviously be slower but also more flexible
12:43:54phoebut the question is, do you absolutely need numbers in there? maybe keywords can be enough
12:47:47schweersThe question is also: how often will this function be called? If it’s not in a tight loop my guess would be that you don`t have to worry about it.
12:48:16schweersEven if you need it in a tight loop, just bind a variable outside (it’s supposed to be constant anyway, right?)