IRC channel logs

2017-10-02.log

back to list of logs

<MuteParrot>Given a GOOP class in a module that has many slots with getter and setter methods, how can I export all the getters and setters?
<MuteParrot>do I have to do (export get-foo get-bar get-baz ...) for each getter/setter, or is there a better way?
<MuteParrot>also, is there a module with a define-method equivalent to define-public? or should I create my own macro for this?
<daviid>MuteParrot: the former. note that you have to re-export if you imported a module tht also defines these getters/setters
<daviid>No, to your last question
<MuteParrot>that's unfortunate.
<daviid>MuteParrot: actually, with no offense what so ever, what you are asking for would not make sence in Guile's implementation of (part of) the CLOS protocol. however, I do understand you and wrote a macro oyu might be interested to use, and, combined with the module definition option #:duplicates (merge-generics replace warn-override-core warn last), will provide a simulation of the clos protocol (which defines a specific module for all
<daviid>clos def* ...
<daviid>here is the macro i'm talking about:
<daviid>MuteParrot: http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/support/goops.scm?h=devel
<daviid>oh, sorry not this one this one:
<daviid> http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/support/g-export.scm?h=devel
<MuteParrot>daviid: thanks!
<MuteParrot>in truth I know little about CLOS. when I'm not using guile I typically use racket not CL
<daviid>MuteParrot: welcome! and here is a simple use so you can better grab what's going on:
<daviid> http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/idata.scm?h=devel
<MuteParrot>awesome, thanks
<daviid>MuteParrot: wc! yes racket oo system has nothing to do with clos (on purpose but imo, it was a very bad decision)
<MuteParrot>yes, racket's oo seems to be not be used for much, probably as a consequence. off the top of my head I can only think of the gui package using it.
<daviid>MuteParrot: I recommend you read this paper http://www.dreamsongs.com/Files/clos-cacm.pdf
<daviid>MuteParrot: actually, this paper is listed here, along with other documents you might be interested to read (intro...) http://www.dreamsongs.com/CLOS.html
<MuteParrot>thanks, I'll check it out
<dsmith-work>Morning Greetings, Guilers
<amz3>o/
<OrangeShark>morning
<jherrlin>Hey folks, i am studying the SICP book and would like to have some feedback on one of the exercises.
<jherrlin> http://paste.lisp.org/display/357498
<jherrlin>
<jherrlin>please give me some feedback on the solution
<jherrlin>found http://community.schemewiki.org/?sicp-ex-2.18 to i guess i have some solutions to compair with
<ft>There are shorter solutions to this, if you think about how cons works.
<ft>Specifically, what's (cons 1 '()) and what is (cons 2 '(1)).
<ft>Yeah. If asked, I'd implement it like the first solution on your link does. I'd probably use a named-let, but that's a minor detail.
<jherrlin>ft: thx for the feedback! i am currently looking at the second solution and trying to understand
<jherrlin>ft: what is the reason you would choose the second?
<ft>I wouldn't want to call append.
<ft>So, I wouldn't choose it.
<jherrlin>ft: because of performance?
<ft>Yes.
<jherrlin>okey, i see! and it's not using tail-recursion so it could blow the stack to, right?
<ft>Yup, that's not a tail call.
<jherrlin>nice, thanks alot ft !
<happy_gnu[m]>\\o/
<happy_gnu[m]>Hi
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>Goodbot
<happy_gnu[m]>I wanna try creating a simple game
<happy_gnu[m]>5-in-a-row
<happy_gnu[m]>In like tic-tac-toe but with more squares
<happy_gnu[m]>I wanna do it following GNOME designs
<happy_gnu[m]>Not because I think they are good but because I think they are simple
<happy_gnu[m]>I should use guile-gnome
<happy_gnu[m]>And does anyone has any suggestions on what else to use?
<happy_gnu[m]>I've never build any GUI before
<happy_gnu[m]>In any language
<cmaloney> https://octodon.social/@craigmaloney/7142549 Some light reading
<daviid>happy_gnu[m]: note that guile-gnome is gnome-2 still, not gnome-3 (it is really good but won't 'look' like gnome-3, obviously), then for such a simple game I'd use guile-clutter (mind you it's a bit more difficult to install, but I wrote a step by step 'guide', and can help here...), or you could look at chickadee as well ... depending on your objectives
<daviid>happy_gnu[m]: https://www.gnu.org/software/guile-gnome/clutter
<happy_gnu[m]>daviid: well my objective is making something for others
<happy_gnu[m]>It doesn't necessarily has to be done for GNOME
<happy_gnu[m]>I just want to make a game or some program that others can use
<happy_gnu[m]>And learn to package it as an executable
<happy_gnu[m]>Like .deb or .rpm
<daviid>happy_gnu[m]: the problem is, given that objective, how easy it is for others to install: it is difficult to install guile-gnome and even a bit more difficult to install guile-clutter, and these are not part of any distro (guile-gnome is in guix actually)
<happy_gnu[m]>Things like that
<daviid>happy_gnu[m]: for info, here are some examples I wrote to help people to start to write clutter apps using guile: http://www.nongnu.org/grip/examples.html
<happy_gnu[m]>daviid: ohh those are good
<happy_gnu[m]>But you say it will be difficult to package it right? :(
<happy_gnu[m]>That is not good but I will try anyway
<daviid>happy_gnu[m]: tx, clutter has everything you need to write a simple game, but for real games you'd want to use another lib
<happy_gnu[m]>I want a simple game
<happy_gnu[m]>I actually wonted to do a program
<happy_gnu[m]>But the only thing I can think of is games
<daviid>happy_gnu[m]: I'd be very happy to help, wrt guile-gnome guile-clutter. then to package, yu best route will be to use guix (which has guile-gnome already) and get help to package guile-clutter, then your game ...
<happy_gnu[m]>And I don't know any Libre program written in guile that I can collaborate.
<happy_gnu[m]>I am learning to package stuff for guix but that is not exactly a program and I looked at GNU cash but it is written in C and I don't even understand GNU Cash
<happy_gnu[m]>Ok
<happy_gnu[m]>I will use that
<happy_gnu[m]>Even if the game is packaged for deb or rpm I doubt it will be very used anyway
<happy_gnu[m]>Is gonna be a simple game
<daviid>happy_gnu[m]: before, take a look at chickadee
<happy_gnu[m]>I am looking at it
<daviid>and there are tons of program you could contribute to
<happy_gnu[m]>It has a lot of documentatiot on web development
<happy_gnu[m]>In scheme? I searched Github but found mostly Racket or Scheme implementations
<happy_gnu[m]>But no actual Scheme programs where I could help
<happy_gnu[m]>Maybe I am just very insecure
<happy_gnu[m]>:/
<daviid>happy_gnu[m]: send an email to guile-user asking to contribute to some project and see ... ?
<happy_gnu[m]>Ohh
<happy_gnu[m]>I didn't know about it
<happy_gnu[m]>Ok
<happy_gnu[m]>I will
<daviid>happy_gnu[m]: no guarantee what so ever, maybe you'll receive no answer, I don't know ...
<daviid>happy_gnu[m]: the guile community is full of lonely hackers :), that come here to ask for tips, code review, ideas for 'how should I do this and this...' but very friendly though
<happy_gnu[m]>:)
<happy_gnu[m]>That's why I feel intimidated
<happy_gnu[m]>You all seem to know a lot about programming
<daviid>happy_gnu[m]: don't be, guilers are always happy to help, and I never seen any pedantic or condenscendent behavior here, just learn do and ask ...
<daviid>happy_gnu[m]: for now, I'd go with your idea to write a simple game, to learn and 'do something' ...
<happy_gnu[m]>Ok
<happy_gnu[m]>I have to go to the doctor now :)
<happy_gnu[m]>Thanks daviid
<daviid>np!