ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
shpx has joined #picolisp
orivej has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
gko has quit [Ping timeout: 264 seconds]
shpx has quit [Quit: Textual IRC Client: www.textualapp.com]
orivej has quit [Ping timeout: 258 seconds]
gko has joined #picolisp
orivej has joined #picolisp
<Regenaxer> ?
rob_w has joined #picolisp
<aw-> ?
<Regenaxer> Sorry, mistype :)
<Regenaxer> Morning!
<aw-> hi
xkapastel has joined #picolisp
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #picolisp
rob_w has quit [Remote host closed the connection]
_whitelogger has joined #picolisp
<rick42> ? <-- lol :)
<rick42> hello all!
<rick42> (almost looks like a message to do with a vague existential crisis :)
<rick42> on that note, i hope all is well with everyone
<beneroth> hey rick42 o/
rob_w has joined #picolisp
<rick42> beneroth: \o
<Regenaxer> Hi rick42, beneroth!
<beneroth> Hi Regenaxer :)
razzy` has joined #picolisp
razzy` has quit [Remote host closed the connection]
razzy` has joined #picolisp
orivej has quit [Read error: Connection reset by peer]
orivej has joined #picolisp
razzy` has quit [Quit: ERC (IRC client for Emacs 26.1)]
razzy` has joined #picolisp
razzy` has quit [Remote host closed the connection]
razzy` has joined #picolisp
razzy` has left #picolisp [#picolisp]
razzy has joined #picolisp
<Regenaxer> Just appeared in #penti https://merveilles.town/@ice/101381993626198633
<razzy> hi, i have stupid trouble. i want to save veriable into file. and this not working as expected (list 'setq '*Var (pretty *Var))
<razzy> i want to save it for future (load)
<Regenaxer> Yes, cause tou set it to the return value
<Regenaxer> (prin "(setq " *Var" "'")) (pretty *Var) (prinl)
<Regenaxer> or (pretty (cons 'setq '*Var *Var))
<Regenaxer> no
<Regenaxer> (pretty (cons 'setq '*Var (cons 'quote *Var)))
<Regenaxer> Something like that, not tested
<razzy> thx
<Regenaxer> Still wrong
<Regenaxer> (pretty (list 'setq '*Var (cons 'quote *Var)))
<Regenaxer> :)
<Regenaxer> Anyway you get the idea :)
<razzy> Regenaxer: i think you do not understand. *Var is really big
<Regenaxer> yes, it may have one million cells
<Regenaxer> What is the problem?
<Regenaxer> OK, I tried
<Regenaxer> the best solution is (pretty (list 'setq '*Var (lit *Var)))
<razzy> i want to end up with (setq *Var (very long pretty list)) in my file
<Regenaxer> 'lit' is made for such things, it quotes only when necessary
<Regenaxer> Sigh, sure. What is the problem?
<Regenaxer> No space on disk?
<razzy> thx, lit works. but i have problem understanding why my aproach do not work
<razzy> ah, lit is double quote ]
<Regenaxer> (lit X) is like (cons 'quote X)
<Regenaxer> but only if necessary
<Regenaxer> eg (lit 1) -> 1
<Regenaxer> or (lit "abc") or (lit (1 2 3))
<Regenaxer> try it
<razzy> uh,.. not very predictable in my mind
<Regenaxer> It is
<Regenaxer> Auto-quoting stuff doesn't need to be quoted
<razzy> i will try mindbending at my part.
<razzy> at my side
<Regenaxer> ok ;)
<razzy> (pretty (list 'setq '*Undo *Undo)) seem to work
<razzy> and i am happier, because it works in my head too
<Regenaxer> I think it is not right
<Regenaxer> You need to quote the value somehow
<razzy> why? how?
<Regenaxer> Otherwise that value in *Undo is evaluated when the 'setq' runs
<Regenaxer> *Undo is eg (a b c)
<Regenaxer> you get
<Regenaxer> (setq *Undo (a b c))
<Regenaxer> bang!
<Regenaxer> So I rather recommend the 'lit'
<razzy> Regenaxer: whole point is that (setq *Undo (a b c)) evaluates when (load) from file
<Regenaxer> Ah, then all right
<Regenaxer> I thought you wanted to preserve the value
<razzy> i wanted to save self-loading code
<rick42> hi, Regenaxer! (late response :)
<Regenaxer> No hurry! :)
<rick42> i didn't know you could do: (scl 10 ...)
<rick42> neat!
<Regenaxer> yes, but not so very useful
<rick42> why not?
<Regenaxer> The scale applies only to (read) calls
<Regenaxer> Not to the body of course, because that *is* already read
<rick42> i see. let me try
<Regenaxer> (scl 10 (load ...
<rick42> ok
<Regenaxer> After all, '.' is just like a kind of read macro
<rick42> ok
<Regenaxer> "macro" may be the wrong term here
<Regenaxer> but it is relevant during read only
<rick42> can't use 1.0, must use something like (** 10 *Scl) for unity instead
<rick42> : (de add42 (X) (+ (* 42 (** 10 *Scl)) X))
<rick42> -> add42
<rick42> : (add42 10)
<rick42> -> 52
<rick42> : (scl 3 (add42 10000))
<rick42> -> 52000
<rick42> :)
<Regenaxer> yes, using *Scl explicitly is also a case
<Regenaxer> eg 'round'
<rick42> T
<Regenaxer> (scl 10 (round ...
<rick42> yes
<rick42> (format "42.0" *Scl) does the right thing at runtime since the . is "protected" in the symbol :)
<Regenaxer> Exactly
<rick42> thanks, Regenaxer. this helps with some functions I have to write
<Regenaxer> :)
<rick42> e.g. normal CDF
<Regenaxer> CDF ?
<rick42> cummulative distribution function
<rick42> in stats
<Regenaxer> oh
<rick42> really probablilty
<Regenaxer> For your job?
<rick42> for fun. (I was reading a "data science" book with the examples in Python but I wrote mine in pil :)
<Regenaxer> Great! :)
<rick42> fixpoint FTW! :)
<rick42> i wrote my cdf relying on erf() from math.so unix lib, so `native` helped there. the marshalling to and from fixpoint to floating worked fine
alexshendi has joined #picolisp
<Regenaxer> ok
<rick42> i used lib/math.l as an example
<Regenaxer> lib/openGl.l has also good examples perhaps
<rick42> ok thanks i'll look there too
<Regenaxer> It does some tricks to avoid 'cons'ing on each call
<rick42> ok that's great because I consed on each call :)
<Regenaxer> Not really a problem, not a bottleneck, but still nice if it can be avoided ;)
<rick42> e.g., (native "@" "erf" (** 10 *Scl) (cons X *Scl))
<rick42> right!
<rick42> oops (native "@" "erf" Unity (cons X Unity)) where Unity is (** 10 *Scl)
<rick42> u know what i mean
<Regenaxer> yes
<Regenaxer> Unity is the number?
<Regenaxer> (** 10 *Scl)
<Regenaxer> ah
<Regenaxer> hehe, I looked the wrong place
<Regenaxer> nevermind
<rick42> yes Unity is 1.0 (but it can't be resolved at read time)
<rick42> ok
<Regenaxer> I see, you set it dynamically
<rick42> yes, so that my user (probably only me :) can change "scale"
<rick42> dynamically
<Regenaxer> right
<alexshendi> Hi Regenaxer, rick42
<rick42> hi alexshendi!
<Regenaxer> Good evening alexshendi
<rick42> alexshendi: I was away in Decmeber, but did you meet any picolisp users at the congress?
<rick42> c3
<alexshendi> I met beneroth.
<rick42> ues!
<rick42> yes! I am jealous of you. i should like to meet him (and you) one day
<alexshendi> The congress is *awesome*, but I always feel that I have by accident missed the best part of it. Because there are so many things to see/do.
<rick42> that's fantastic
<rick42> so, i wrote this convenience function called `fix` that I use to convert non-fixpoint numbers (usually integers) into fixpoint numbers
<rick42> : (fix 1)
<rick42> -> 1
<rick42> : (scl 3 (fix 1))
<rick42> -> 1000
<rick42> : (scl 3 (fix "1"))
<rick42> -> 1000
<rick42> : (scl 3 (fix '((1 2) (3 4))))
<rick42> -> ((1000 2000) (3000 4000))
<rick42> the last one is a [representation of a] 2x2 matrix :)
<rick42> now, dynamic unity can be expressed as (fix 1) and other integers like 2 (where I used to say (* 2 Unity)) now I say (fix 2)
<Regenaxer> Perfect
<Regenaxer> Looks like these are good candidates to extend your article
<Regenaxer> the blog post
<rick42> yes. i'm planning on a follow up article ... after I wrestle with more of these issues.
<Regenaxer> Good news
mtsd has joined #picolisp
mtsd has quit [Quit: WeeChat 1.6]
orivej_ has joined #picolisp
orivej has quit [Read error: Connection reset by peer]
rob_w has quit [Quit: Leaving]
alexshendi has quit [Read error: Connection reset by peer]