IRC channel logs

2018-06-08.log

back to list of logs

***Raimondii is now known as Raimondi
<manumanumanu>Good morning everyone!
<manumanumanu>What are you all up to today?
***Raimondii is now known as Raimondi
***Raimondii is now known as Raimondi
<OrangeShark>happy friday
<manumanumanu>has anyone seen daviid lately?
<OrangeShark>manumanumanu: daviid said hello yesterday
<manumanumanu>Damn this timezone bullshit, I am never online when he is
<manumanumanu>:(
<manumanumanu>For those interested, I have written a define-method* macro that adds optional arguments to goops define-method using the regular goops dispatch: https://bitbucket.org/bjoli/goops-optional/src/default/optional.scm
<mwette>My posts to winolog are not working anymore. Anyone else experienced the same issue? Anyhow, I wanted to thank Andy W for the Offner reference. I'm loving that one. (ref: http://wingolog.org/archives/2014/07/01/flow-analysis-in-guile)
<daviid>hello! manumanumanu just got in ... :)
<manumanumanu>daviid: ah!
<manumanumanu>daviid: https://bitbucket.org/bjoli/goops-optional/src/default/optional.scm
<manumanumanu>optional arguments for goops define method, relying on the proper goops method dispatch
<manumanumanu>no keyword arguments, because that does't really play well with the dispatch and will slow things down
<manumanumanu>there is a bug in it currently though. The optional bindings don't evaluate in order (like lambda*), but that is an easy fix
<daviid>manumanumanu: ok, tx. as you know, use the versio implemented by mark, which I added to grip ... can't remember if it was you who recently did ask and I pastd the link ....
<daviid>that version allows keyword arguments
<manumanumanu>but it was an ugly hack that doesn't play well with goops
<manumanumanu>if all you need is optional arguments, my version is nicer :D
<daviid>ok
<manumanumanu>this way does type dispatch for the optional arguments, meaning you can have overloaded define-method based on optional arguments
<daviid>why do yu say makr's version does not play well with goops, I onlu used it once actually, did you find a bug or somehting?
<manumanumanu>marks version doesn't rely on goops type dispatch, but on a hack using lambda*. My version can distinguish from overloaded methods with differently typed optional arguments
<manumanumanu>the difference is probably not of much practical use
<daviid>manumanumanu: I see, but I think I have a different opionion here :), and would not expect a dispatch for these optional arguments: you see, if that was the case, I would simply write another method (or other methods if more then one arguments ...)
<manumanumanu>to be honest
<manumanumanu>well, this macro defines all the different methods (define-method* (hej #:optional a b c) (display (or a b c)) defines (hej a), (hej a b) and (hej a b c)
<daviid>and I generally prefer keyword args to optional args - optional args, imo, only works well when you are certain that the proc or the method will only take 1, and that 'API' will never change ... in my experience, that is a very rare case ... so I generally use keyword args ...
<manumanumanu>I use some methods on the repl for fast conversions to strings and such. for that my implementation makes sense, with a lot of overloaded methods
<manumanumanu>anyway, it was a fun exercise
<manumanumanu>i like writing macros
<daviid>manumanumanu: good to have fun :) what do you mean ' with a lot of overloaded methods'? do you have an example I can look at (jut being curious here)
<manumanumanu>daviid: not now. going to bed. It is getting late, and I have a flight to catch in 5 hours :D
<daviid>manumanumanu: oh, good night then, never mind