a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by mk
mk  ·  3557 days ago  ·  link  ·    ·  parent  ·  post: Bugski: Problem with Drafts Discovered FYI

That actually resulted from an odd bit of code left over from Paul Graham whereby the name shown is the variable itself, i.e. 'draft', so it made the most sense to follow it by yes/no. It sounds ludicrous, but there was no simple way to give the toggle a different name without undoing a gordian knot of code. It's really a piece of work. Last week, I did just that, and that's why the settings page has been updated to have actual descriptions on the toggles. I'll do the same to the edit page in short order.





user-inactivated  ·  3557 days ago  ·  link  ·  

I saw a horrible solution to a similar problem in a Common Lisp codebase that shall remain nameless. They defined a read macro to look up a token in a hash table and use that as the object read, so a symbol could be given the name |Save draft?|, then entered in the hash table with the key "draft", and the string "$draft" would be read as the symbol |Save draft?|. It was probably the grossest thing I've ever seen in a CL codebase, but it did solve the problem of having to present friendly strings to people who were not lisp programmers familiar with the project with minimal changes.

I have no idea whether Arc has read macros, and it's probably a bad idea to do that if it does, but it has been done.

kleinbl00  ·  3557 days ago  ·  link  ·  

That definitely sounds like something not worth fixing.

mk  ·  3557 days ago  ·  link  ·  

Unfortunately it is for other reasons. Being able to give variable toggles any name we choose is an incidental benefit.