Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

so it's hot code reloading on steroids? really neat idea, I'm working on a similar Lisp-style language and will probably adopt this idea (and cite you of course). In my language, you can redefine any symbol, even numbers, so (def 10 12) is valid code (so is (def def 42), which breaks `def`!).

I wonder what use cases there are for such extreme flexibility, aside from funs and games!



Redefining 'def' is a trick used in Tcl to make "safe" configuration languages exposed to the end user. You define all of your configuration options as functions and then undefine everything else (including "proc" which corresponds to defun) allowing you to evaluate users' config files with this safe interpreter as code.

I can't find a good source for this practice of manually undefining functions, but here is a link to relevant built-in functionality: https://www.tcl-lang.org/man/tcl8.6/TclCmd/safe.htm


None; it's for fun and games. But maybe thats the most enjoyable use case anyway.


I couldn't agree more


Please feel free to use any/all of it, it's really fun to play around with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: