freenode/lisp - IRC Chatlog
Search
9:36:08
svillemot
I get an internal server error when trying to submit an issue on gitlab.common-lisp.net ; is there a maintenance going on?
9:36:40
mfiano
Is there any workaround to be able to use DESTRUCTURING-BIND to destructure the car/cdr of a possibly NIL value? (destructuring-bind (foo . bar) value) fails on nil
9:41:02
mfiano
It's been a while since I used CL. I almost forgot destructuring lambda lists were almost identical to macro lambda lists. Thanks!
12:18:31
ogamita
hajovonta: it's useless to "re", since irc already tells us: *** hajovonta (~hajovonta@business-89-135-192-225.business.broadband.hu) has joined channel #lisp
12:23:50
hajovonta
back in the old days, in the previous millennia, we used to say "re" when reconnected
12:59:24
jcowan
IRC tells us, but what it tells us can't usually be trusted, what with bouncers and automatically-reconnecting clients. "re" says you're there in person.
13:13:28
jackdaniel
otherwise what's the point of it? 400+ people saying re may get tedious if we follow proactive convention
13:18:44
hajovonta
sometimes connection drop is only momentary but several minutes have to pass for IRC server to timeout your connection
13:20:23
jackdaniel
I believe that there is a fine spot between efficiency and politeness and being radical in any direciton leads to an unbearable situation
13:21:01
hajovonta
back in the old days i used IRCNET and there was no nickserv, so we could be in a channel with multiple nicks especially on modem and other unstable connection types
13:21:37
hajovonta
I guess nickserv doesn't prevent me from using multiple nicks either, but I'm too lazy to set up alternative nicknames
14:00:07
jcowan
dim: I disagree: politeness can get someone to listen to you who otherwise would not.
14:22:50
dlowe
as a collegue of mine once said, "there's more to politeness than not yelling at people"
14:23:38
dim
also about getting someone to listen to you, a quote I like sayth: “I never learnt anything while I was talking”.
15:57:48
jmercouris
I want to make it so that when someone defines a mode, they can execute a form that sets default keybindings for that mode
15:58:07
jmercouris
the keybindings are stored in a global hashmap with the same name as the class, just surrounded by earmuffs
15:58:28
jmercouris
why global hashmap? so that when you change a keybinding in that hashmap, it'll change in all running modes on all buffers
15:58:43
makomo
can't you write a macro that expands into (progn (defclass ...) <keybind-registration-forms>)?
15:59:08
jmercouris
makomo: I could, I thought about that, was just wondering maybe there is something better than that
15:59:24
jmercouris
maybe I should actually have something like (defmode ...) could be nice at any rate
15:59:54
makomo
i would say that would be a neater option as you're relying on standardized stuff (standardized meaning "in the CLHS")
16:01:02
makomo
well i was just thinking that it would be nice to abstract away the fact that modes are classes underneath
16:02:01
makomo
but, even if you do abstract away the fact that a mode is just a class, you don't have to turn it into a "black box" thing
16:02:27
makomo
i.e. the modes would still be "transparently specified" -- you would say "modes are indeed CLOS classes and have X as their superclass"
16:02:52
makomo
rather than "use *ONLY* DEFINE-MODE as i might change the representation of modes later on"
16:04:00
makomo
now, i don't think there's a general way of deciding whether or not one should define something transparently or not. it's mostly about creativity/gut feeling i would say :-)
16:04:33
ogamita
jmercouris: notice since defclass is a macro, you can play tricks with *macroexpand-hook*.
16:04:47
shka_
jmercouris: i think that you are better of using :allocation :class for your shorcuts
16:05:36
ogamita
jmercouris: but in your case, you should not let your users use defclass to define modes! Provide them with a define-mode macro, and do whatever you want!
16:06:56
ogamita
jmercouris: note also another example: CLIM defines its own defclass and defmethod macros, shadowing CL's ones, and when you want to use CLIM, you (:use "CLIM-CL") instead of (:use "CL").
16:07:27
ogamita
jmercouris: but since you're just defining modes, not generic classes in a GUI environment or something, define-mode is better.
16:10:39
jackdaniel
i.e some people are interested in seeing kerning included in McCLIM master branch
16:13:58
ogamita
makomo: just showing a derivation of the rules to expand ,@,@ would be enough proof.
16:19:44
jmercouris
here's the macro I came up with: https://gist.github.com/jmercouris/c8f5738ac6ac9ea3c4132edba73527f6
16:22:17
shka_
jmercouris: simply add base class for all nodes, add slot for this map, and during set default-initarg for it to your *map*
16:23:44
jmercouris
if you can't see anything hugely egregious with my macro, I think I will use it instead
16:25:07
jmercouris
I was thinking about putting it in another body for deferred execution until run time or something
16:25:50
makomo
jmercouris: then you can wrap the body within a lambda, store the lambda somewhere and call it later
16:26:28
jmercouris
makomo: I'll wrap it within a lambda, register it in a list, and then execute on startup, that makes the most sense
16:26:46
makomo
jmercouris: yeah, as ogamita says, the macro is pretty bare-bones right now, providing almost no abstraction over defclass
16:27:23
makomo
still though, using it anyway just to give a name to a concept ("defining a mode") is ok imo, even if the macro is trivial
16:27:27
shka_
i still think that managing shared setting for all instances of modes should be somehow placed into the class itself
16:27:49
kuwze
hey does anyone know what mocl is based on? I thought it was ecl but it can't be considering ecl is lgpl and won't allow for distributing bundled binaries (which is what I believe mocl offers)
16:32:04
ogamita
kuwze: it felt like mocl could have been based on clicc, but I haven't seen its sources (they're available for $). It's possible it was written from scratch.
16:32:53
ogamita
Ie. you have a (large) static subset of CL that is translated to C, with a small runtime library.
16:36:00
ogamita
It would be worth it to take clicc and modernize it to make a free competitor to mocl (which is has a lot of bugs and is not much maintained).
17:18:31
jasom
luis: I know there are ones that generate html, and markdown is a superset of html, so technically, yes...
17:44:43
jasom
luis: maybe? There are so many document generators that it's hard to keep track; sabra did a comparison of them a couple years ago, and he notes that it's already out-of-date.
17:46:31
jasom
https://sites.google.com/site/sabraonthehill/lisp-document-generation-apps/lisp-generation-apps-v1 <-- has a "multipage" row in the summary table
18:16:49
makomo
jasom: thanks for the link, sabra has quite a few comparisons i see. i appreciate the effort
18:23:00
makomo
ogamita: how did you perform the conversion of CLICC's package name when you first imported the project?
18:23:25
makomo
was it just a basic search-and-replace and you had to eyeball every replacement to make sure you didn't break something, or did you use something more sophisticated?
18:50:59
another-user
hi, i would like to define a method which will be called when object has changed, like :after method for setf of spicific :accessor but for whole object
18:55:21
Bike
another-user: you could define a metaclass and then a method on (setf slot-value-using-class). reinitialize-instance might result in it running more than once, though.