beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
seninha has quit [Ping timeout: 250 seconds]
<abu[m]> Yes, this is all there
<abu[m]> Direct structure editing if called with a list of symbols
<abu[m]> (vi (collect ...)) or (vi '(sym1 sym2))
<abu[m]> 'v' is a shortcut (v sym1 sym2)
<abu[m]> The REPL is the command window on bottom. If a space is after the column, the expression is evaluated
<abu[m]> : (* 3 4)
msavoritias has joined #picolisp
abu[7] has joined #picolisp
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
seninha has joined #picolisp
seninha has quit [Ping timeout: 260 seconds]
<abu[7]> k
<abu[7]> k
<abu[7]> oops
abu[7] has left #picolisp [#picolisp]
msavoritias has quit [Remote host closed the connection]
seninha has joined #picolisp
<skyjuice> <abu[m]> "Yes, this is all there" <- ty, just need to remap a few keybinds and I'll be set.
pablo_escoberg has joined #picolisp
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg>  So I took your advice and made the thing do what I want before abstracting.  Result here:  http://pb1n.de/?28c72d .  Problem is, the "finish" function does not receive the correct filenames because "This" is out of scope by the time it fires.  Is there a standard way of dealing with this?
<abu[m]> You can remember it globally, or put some env into the finish clause
<abu[m]> But I would not do it this way
<abu[m]> Have you looked at my example?
<abu[m]> Program exit is not the right place
<abu[m]> You need some close> method
<abu[m]> Plus use (tmp ) for such files, so they are cleaned up automatically
<pablo_escoberg> ok, I'll try adding a cleanup method and calling that on "finish".  Should work...
<abu[m]> I think you should forget about finish here. This is not the place to clean up objects
<abu[m]> Objects are typically very many in a system
<pablo_escoberg> right, but I'm not cleaning up the object, just the temp files.
<pablo_escoberg> and I want objects of this class to clean up after themselves so to speak.
<abu[m]> yes!!
<abu[m]> And temp files are with (tmp )
<abu[m]> Don't you have my example?
<pablo_escoberg> not sure which example you mean...
<abu[m]> I forgot too ;) When was it?
<abu[m]> I made a complete example
<pablo_escoberg> That's the thing, I don't recall any example of using finish, except when you told me to use it instead of *Run.
<pablo_escoberg> but I'
<pablo_escoberg> m pretty sure that used local variables rather than symbol props
<pablo_escoberg> and in fact, if I get the props and set them to local variables, it works.  It's just that it's really ugly and defeats the purpose.
<abu[m]> wait
<pablo_escoberg> waiting...
<abu[m]> I did spend time to write it, but you didn't even look at it
<pablo_escoberg> sorry, but I really do read through everything you send me.  I really don't remember this one, and I checked back in the logs.  Really sorry.  I'll figure it out, nvm
<abu[m]> I think it was this: http://pb1n.de/?f85b57
<abu[m]> I expected you check it
<pablo_escoberg> Does close> get called automatically at object destruction?
<abu[m]> no
<pablo_escoberg> So I'm not seeing where it gets called.
<abu[m]> If you insist on 'finish', put your objects into a global *SqlObjects
<abu[m]> Then (finish (mapc 'close> *SqlObjects))
<pablo_escoberg> OK, but what is the alternative?
<pablo_escoberg> where should I call "close>" ?
<abu[m]> I just wrote it two lines above (?)
<pablo_escoberg> But it seems you have a different idea in mind for this?
<pablo_escoberg> or is that how you recommend I clean up?
<abu[m]> This is just how I would do it. But I don't know your exact plans, so it is just a proposal. You are free of course ;)
<abu[m]> Might be completely different, just as far as I understood your plans
<abu[m]> I understood you want to encapsulate SQL queries in objects
<pablo_escoberg> Eventually, yes.  Right now, I'm working on the plumbing for it.
<abu[m]> So 'T' and something like 'close>' come to mind. It should be symmetrical
<pablo_escoberg> Sure, but there is no automatic object destructor, unlike the T constructor.
<abu[m]> right
<abu[m]> It is you who knows when the object is done
<abu[m]> I wonder if OOP is useful here at all
<abu[m]> How many such objects do you expect?
<abu[m]> Anyway
<abu[m]> (=: inp (tmp (pack "in" (inc (0)))))
<abu[m]> Whis creates temp files
<abu[m]> When the process terminates, the whole directory is deleted
<abu[m]> So you are sure they are gone even if close> is never called
<abu[m]> (=: ifd (open (: inp))) stores the file descriptors in the objecbn
<abu[m]> So open is called only once
<pablo_escoberg> Right, I may not be able to do that because "out" is called inside of "in" but the tmp function will take care of the cleanup, so at least there's that.
<skyjuice> Hello all
<abu[m]> Hello skyjuice! ☺
<abu[m]> Must go now. bbl :)
pablo_escoberg has quit [Quit: Client closed]
<skyjuice> where the final "bs" or "bn" execute the command without the need to press "RETURN"
pablo_escoberg has joined #picolisp
<pablo_escoberg> I wouldn't ask this, but you keep pointing me to cool things that picolisp does that I missed in the docs:  Is there a regexp engine of any kind in picolisp?
<pablo_escoberg> I'm aware of match, but I'm trying to build a really simple template system, and replacing substrings with chop/pack/split is rather tedious.  I'll hide it in a utility function if need be, but if there's something already out there, I'd rather use that.
seninha has quit [Ping timeout: 260 seconds]
pablo_escoberg has quit [Ping timeout: 246 seconds]