off-topic

jasalt 2025-09-02T16:27:34.358599Z

I was looking how to improve some verbose PHP interop syntax today and came up with an ingenious Emacs font-lock setting for beginnings of symbols starting with php/ in the meanwhile.

p-himik 2025-09-02T16:33:49.840919Z

That's a whole parade of them! Unless php/ is used extensively in all kinds of contexts, for the particular case of getting globals I'd probably just create a get-in-globals fn that could be called like (get-in-globals ["_SERVER" "PHP_SELF"]).

jasalt 2025-09-02T16:36:34.559799Z

Indeed!

jasalt 2025-09-02T16:36:58.352029Z

Had similar idea sent as issue https://github.com/phel-lang/phel-lang/issues/939

jasalt 2025-09-02T16:38:08.325059Z

Recently attribute/method access via php/-> was improved to accept nested calls also which is quite similar.

jasalt 2025-09-02T17:01:31.932249Z

Special threading form might help also. This imaginary PHP-> has different meaning from built-in php/-> which indicates object->method() style access. It would slam php/ in front of every relevant symbol's name, but would need to avoid messing other symbols.

(PHP-> $GLOBALS
          (aget "_SERVER")
          (aget "PHP_SELF"))

   (PHP-> $GLOBALS
          (aget-in ["_SERVER" "PHP_SELF"]))

jasalt 2025-09-07T04:54:12.650149Z

aget-in got added https://github.com/phel-lang/phel-lang/pull/944 goes like hot knife through butter