8 ms·
(I am not OP and I never done lisp.) >How exactly do you evaluate snippets in some environment even with REPL? I mean most code in a large system is part of a
by simion314 5y ago
(I am not OP and I never done lisp.)
>How exactly do you evaluate snippets in some environment even with REPL? I mean most code in a large system is part of a context that is required
This is a bad smell for me. You should always try to split your code in small pure functions that do one thing, it will help you with readability, with refactoring, with testing and depending on environment you could just replace the function with an different one at runtime.
- Lvl999Noob 5y agoBut you still need the types that are required and you need to define the functions that your snippet calls. Those in turn could require their own types and functions and so on. Unless you don't have much in the name of types and so you can easily define whatever you need. That still leaves the functions that snippet depends on.
- simion314 5y agoI try to create new types if needed instead of passing to a function too many parameters. Also say a function needs the user email you don't pass it the big User object you pass only the email. The issue I hit though is with code that evolves over years, it starts simple and then each team member had to add some new feature and the simple functions get larger and alrger , the number of parameters increases etc , the solution is to take the time and re-analyze the updated problem and refactor or rewrite the solution to be again composed from simple parts that do one thing. let me know If I misunderstand the thing you said about types, or you referring mainly about REPL