IRC channel logs

2020-12-14.log

back to list of logs

<chrislck_>you can do it manually
<nixo_>chrislck_: thanks, I hoped there was something less error prone
<nixo_>Also, I would need to modify the copy procedure if properties are added with make-object-property
<chrislck_>you can automate it
<chrislck_>nixo_ https://pastebin.com/raw/Pxdm1QTG
<nixo_>chrislck_: thanks a lot!
<chrislck_>question for experienced guilers: is (apply proc lst1 ... lstn) slow if lstn is a very large list?
<daviid>chrislck_: it is always difficult to answer these quiz, what is 'very large' in your case ... and, if you are concerned, you should measure (,time ...) and as well, try vectors (using list->vector to start with, but specializing if yu have a type ...) ... and, if you receive lists 'in the first place', you'll have to take into account the transformation time as well of course ...
<chrislck_>daviid: thx more of a hypothetical question. given eval/apply are the source of all things lisp, I'd think apply should be fast. but not sure whether it does inefficient list traversals internally.
***chrislck_ is now known as chrislck
<daviid>chrislck: you'll rarely need eval, and apply is not slow
<daviid>apply is nearly as fast a 'direct' procedure call, if that what matters to you
<daviid>the problem is your proc :), and the size of the lists, of course ...
<chrislck>thanks, it's about creating habits, writing good code, more than exact performance
<daviid>chrislck: i know you are working with/upon gnucash, my advice is write clean code, first and above all, very clean, very readable and highly maintanable code, then where you see 'bottleneck', measure and see what/how yu can improve ...
<chrislck>I remember wingo's report about inefficient string-append vs string-concatenate for instance; this is not obvious reading manual
<chrislck>(apply string-append list-of-strings) vs (string-concatenate list-of-strings)
<chrislck>(2nd one was much much faster) (this may be obsolete)
<chrislck>thx gnucash is already in a much better state than a few years ago
<daviid>chrislck: ok, but exactly when does the later starts to be faster then the former ... although in that particular case, even the 'write clean code' would suggest to use string-conactenate ...
<daviid>and yes, it probably is 'obsolate'
<daviid>chrislck: i know it is in a much better state, contragt and thanks! you've done an impressive work
<daviid>though i don't use it, i read here and there ... so i did see your work ...
<daviid>somehow
<chrislck>lol latest work finally does (use-modules) correctly https://github.com/Gnucash/gnucash/pull/831
<daviid>i did read recently about you gor rid of the warnings, use-module ...
<daviid>ah, cross typing )
<chrislck>and I'll shamelessly copy from civodul's fine work at https://github.com/Gnucash/gnucash/pull/836
<daviid>chrislck: well done, you may and should shamelessly copy any of free s/w work, especially our maintainer's and other 'advanced' guiler's work of course :) -
<daviid>I do that to of course, we all do ...
<daviid>str1ngs: do you use the <gdk-event> class and accesors in nomad(g-golf)?
<daviid>I mean the accessors, the class is instantiated for users whenever an event is propageted ...
<apteryx>any clues how to prepend a line to a file using Guile?
<RhodiumToad>write the line to a new file, copy the old file content after it, close new file, rename over old file
***apteryx is now known as Guest12417
***apteryx_ is now known as apteryx
<srandon111>folks, any good book similar to practical common lisp for guile ?
***srandon111 is now known as sookablyat
<leoprikler>sneek later tell srandon111 many people learn Scheme through SICP
<mwette>sneek: later tell srandon111 search for "The Scheme Programming Language", ; I like that book a lot, available on scheme.com/tspl4
<dsmith>sneek!
<sookablyat>leoprikler, yes i know SICP but it's not similar to practical common lisp at all!
<leoprikler>tbh I've read neither, so ¯\_(ツ)_/¯
<dsmith>sneek: botsnack
<sneek>:)
<tohoyn>sneek: botsnack
<sneek>:)
***srandon111 is now known as sukablyat