ashok-khanna / autologger

A simple logging tool for Common Lisp
GNU Affero General Public License v3.0
5 stars 0 forks source link

special declarations of collected-functions #5

Open informatimago opened 2 years ago

informatimago commented 2 years ago

https://github.com/ashok-khanna/autologger/blob/b2632c0ffec0d22afe755cc6e5afc816be28a2a9/cl-autologger.lisp#L268 There's no point in declaring it temporarily special, if it's not directly referenced in this scope. Similarly for other occurrences where it's declared and not referenced.

Since the same pattern, declare special / push occurs in several functions, such as in: https://github.com/ashok-khanna/autologger/blob/b2632c0ffec0d22afe755cc6e5afc816be28a2a9/cl-autologger.lisp#L238 it should be abstracted away in a collecting function.

So this push can be written as:

(colllect-function (cadr fn-list))

and only in collect-function there will be a reference to collected-functions and a special declaration will be required.

ashok-khanna commented 2 years ago

Well noted. I want to write an autolaunch function since its a bit annoying sometimes to have to log and then unlog, so basically autolaunch will be something like with-open-file which first logs all the functions, evaluates and sends the results to Emacs, and then unlogs all the functions; I will fix for the above and the other changes around functions vs. macros within that code refactor