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
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
seninha has quit [Ping timeout: 264 seconds]
<pablo_escoberg> Quick suggestion:  The docs for the ^ function don't mention it's use inside the make function.  I would add it, but I might get it wrong so I'll let someone more experienced handle it if you feel it's warranted.
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
seninha has joined #picolisp
abu[m] has quit [Server closed connection]
abu[m] has joined #picolisp
seninha has quit [Ping timeout: 264 seconds]
<abu[7]> Good morning pablo_escoberg! So you found out that NCONC in CL is just conc in pil
<abu[7]> But I don't understand what you want to do ...
<abu[7]> And concerning '^', you mean to mention it being used in the ref for 'fill' (not 'make') right? Will do that when I'm back.
<abu[7]> hmm, but strictly these are different things. '^' is just a symbol, being set to some value at errors or when debugging
<abu[7]> In 'fill' is is used as a marker
<abu[7]> In Pilog, '^' it is used again in some different context and meaning
<abu[7]> So better keep this separate in the ref
<pablo_escoberg> OK, for the ^ what happened was I did a "show" for something or other (don't remember what), saw it in the definition, went to the docs and saw nothing except holding an error, which didn't make sense in context at all.  Later, I was looking at the fill docs (yes, fill, not make; sorry) and realized what it was.  Seems like there should be some
<pablo_escoberg> kind of reference to it in the docs in case somebody get there the way I did.
<pablo_escoberg> As for the pastebin, I'm trying to return a [not sure what to call it - "non-lambda"?] that accepts an additional argument and processes it by assigning it's value to a similarly named property of This.
<abu[7]> Yeah, there are many symbols used by themselves, just as a symbol, nothing to do with their value
<pablo_escoberg> Right, just the name of the symbol rather than its value.
<pablo_escoberg> I'm picking up on using that.
<abu[7]> T
<abu[7]> What could that lambda be used for?
<abu[7]> I feel there must be something simpler
<abu[7]> Also we should fix other issues
<abu[7]> e.g. "(setq @args" etc.
<pablo_escoberg> You are probably right, hence that part of my question.  What I am looking to do is be able to define a function that already has some functionality built in, namely processing the last argument as options and  initially just assigning them to local properties (eventually there will be some override possibilities which is why this is necessary,
<pablo_escoberg> but I'm stuck here for now).
<abu[7]> ok, so let's tackle it step by step
<pablo_escoberg> So instead of (de 'foo (bar Opts) (process Opts) (do stuff with bar given opts))
<abu[7]> first the goal
<abu[7]> Can't this be done with 'redefine'?
<pablo_escoberg> let me have a look
<abu[7]> 'redef' I mean
<pablo_escoberg> possibly, I'll have to play a bit.  But I really need to understand the following, I think before I can get anything done:
<pablo_escoberg> ! (conc (car Args))
<pablo_escoberg> -> '(Msg)
<pablo_escoberg> ! (conc '(Msg))
<pablo_escoberg> -> (Msg)
<pablo_escoberg> ! (conc (conc (car Args)))
<pablo_escoberg> -> '(Msg)
<pablo_escoberg> There is something very fundamental I'm missing here because I simply don't understand how that can be.
<abu[7]> 'conc' takes a list or cell as first arg
<abu[7]> like NCONC
<abu[7]> So Args is the list of Arguments
<abu[7]> but (conc (car Args)) concs nothing
<pablo_escoberg> but (car Args) and '(Msg) seem like they should be the same thing.  Why does it now process them the same?
<abu[7]> What exactly is in 'Args'?
<abu[7]> or do you mean 'cons'?
<abu[7]> (cons X) is the same as (list X)
<pablo_escoberg> This is in the context of that pastebin I posted.  I did (debug 'opt_fun) and then ran ( setq xxx (opt_fun '(Msg) (prinl Msg)))
<pablo_escoberg> the paste above is from inside the 'opt_fun function
<pablo_escoberg> Also, your last msg got garbled by irc, and came out as emojis
<abu[7]> oh
<pablo_escoberg> yeah, I am completely confused by those three lines.
<pablo_escoberg> I realize I'm not in Kansas anymore lisp wise, but this is completely outside my experience.
<abu[7]> no worry :)
<pablo_escoberg> I usually think of lisps as formal systems wherein you can just do simple substitutions and you're ok.
<abu[7]> exactly
<pablo_escoberg> not so here, apparently
<abu[7]> -> ('(Msg Opts) (map '((opt) (=: (car opt) (cdr opt))) Opts) (prinl Msg))
<abu[7]> this is not a lambd
<pablo_escoberg> right!
<pablo_escoberg> I have been wracking my brain trying to get that car out of the goddamn quote!
<pablo_escoberg> It just won't let me!
<abu[7]> how should it look like?
<pablo_escoberg> ditch that first quote.  I've been trying to do that all day.
<abu[7]> (=: does not evaluate
<abu[7]> I think you should first print here the desired result
<pablo_escoberg> I don't want it to, at this point
<abu[7]> Then build it
<pablo_escoberg> probably, but I had no idea I would run into this kind of thing.
<abu[7]> Let me write
<pablo_escoberg> It seemed like it should be straightforward, but I guess I'm having a harder time than I thought wrapping my head around the whole "no compile" thing even though it was one of the things that drew me to picolisp.
<pablo_escoberg> And yes, please go ahead and write, but if you could help me uderstand those 3 lines, it would go a long way toward helping me understand the system
<pablo_escoberg> BTW, before those 3 lines:
<pablo_escoberg> ! Args
<pablo_escoberg> -> ('(Msg) (prinl Msg))
<abu[7]> What is an example for Opts?
<abu[7]> it is a list of values?
<abu[7]> ah
<abu[7]> key-value pairs
<pablo_escoberg> yup
<abu[7]> Moment
<pablo_escoberg> sure
<abu[7]> You want http://pb1n.de/?1de948
<abu[7]> And to modify an existing function you could 'set' a new value and use 'daemon' to insert the for loop
pablo_escoberg93 has joined #picolisp
<abu[7]> How should 'opt_fun' be used? Modify an existing function, or define a new one?
<abu[7]> I don't get the purpose
<pablo_escoberg93> define a new one, or rather many new ones, all of which share that first line
pablo_escoberg has quit [Quit: Client closed]
<abu[7]> ok, moment
<pablo_escoberg93> Rather than write it over and over, I just figured I would create a new de/def alternative that does just that.  It's not for general use, unless somebody wants to.
<pablo_escoberg93> But personally, the reason I'm drawn to languages like this is that I hate repeating myself in code.
<abu[7]> first try: http://pb1n.de/?29b7e5
<abu[7]> Better not use 'conc' as it destroys the original argument
<abu[7]> otherwise 'conc' instead of 'append'
<pablo_escoberg93> Well, per the pastebin, it works, but I'll have to wait until tomorrow to really dig into it and understand why.  It's almost bed time.  Thanks again.
<abu[7]> Welcome! :)
<pablo_escoberg93> Though I'm still dying to understand those 3 lines above...
<abu[7]> Which 3 lines?
<pablo_escoberg93> Actually, for clarity 4 lines:! Args
<pablo_escoberg93> -> ('(Msg) (prinl Msg))
<pablo_escoberg93> ! (car Args)
<pablo_escoberg93> -> '(Msg)
<pablo_escoberg93> ! (conc (car Args))
<pablo_escoberg93> -> '(Msg)
<pablo_escoberg93> ! (conc '(Msg))
<pablo_escoberg93> -> (Msg)
<pablo_escoberg93> ! (conc (conc (car Args)))
<pablo_escoberg93> -> '(Msg)
<abu[7]> Why (conc (car Args)) ?
<abu[7]> This makes no sense
<pablo_escoberg93> I kept trying to get it out of the quote context
<pablo_escoberg93> But still, why are the results differenct?
<abu[7]> There should be no quote involved
<abu[7]> I don't know where to start to explain
<pablo_escoberg93> OK, I'll gather some more data and make a pastebin about it tomorrow.  It's really quite weird and I think understanding it will take me a long way toward understanding picolisp.  Thanks again for all the help, have a great day, and I'm bummed we're in such different time zones.
<abu[7]> yeah :)
<abu[7]> "why are the results differenct?": because one tim you call 'conc' with '(Msg) and one time with (Msg)
<abu[7]> Note the quote!
msavoritias has joined #picolisp
<pablo_escoberg93> Append is the method I was missing.  20 years, apparently, is a long time to be away from lisp, especially when you're trying to learn a nontraditional one.  Really appreciate all the help and patience.
<abu[7]> So now take a good sleep, and later we can clear up things :)
<abu[m]> "Note the quote!" is a cool slogan for Lispers. It rhymes, and gives a very important advice ☺
pablo_escoberg93 has quit [Ping timeout: 246 seconds]
seninha has joined #picolisp
pablo_escoberg has joined #picolisp
<pablo_escoberg> Yeah, getting used to the quoting again is proving challenging, as is getting used to the "macro" system.  I keep trying to use reader macros like macros :D.  Good evening, BTW :D.
<pablo_escoberg> But I did want to get back to my question about the docs for "^".  Do you really think the docs for ^ shouldn't mention it's used in fill?  there isn't even a mention of it in "see also".
<pablo_escoberg> Oh, wait!  I'm looking at the code again, and I still don't get it!  (car Args) is shown to be set to '(Msg).  When I conc it, it give me back '(Msg) again.  When I (conc '(Msg) directly, it gives me (Msg), which is what I want.  I still don't understand why this is happening.
<pablo_escoberg> So still two things, sorry...
<abu[7]> We must first decide what exactly you wanw
<abu[7]> want
<abu[7]> Did you see my proposal (de opt_fun (Fun Opts) ... ?
<abu[7]> I think, passing evaluated args is more useful than (de opt_fun Args ...
<abu[7]> So you pass a function ((Msg) (prinl Msg)) and a list of pairs? ((a . 1) (b . 2))
<abu[7]> Such things must be made clear first
<abu[7]> It outputs http://pb1n.de/?1de948
<pablo_escoberg> No, what you wrote is great.  I just need to understand why I am getting two different results for what looks to me like the exact same thing.
<abu[7]> It is not the same. Once you pass (Msg) and once '(Msg)
<pablo_escoberg> But (car Args) is '(Msg) not (Msg) or so the repl tells me.
<abu[7]> yes, but (conc '(Msg)) is not
<pablo_escoberg> nowhere am I doing anything to (Msg) .  (Msg) is the result I want.
<abu[7]> you need (conc ''(Msg))
<pablo_escoberg> No, that's not the question.
<pablo_escoberg> Let's go step by step.
<abu[7]> yeah
<pablo_escoberg> (conc '(Msg)) gives me what I want, which is (Msg).
<pablo_escoberg> Thing is, '(Msg) is currently in (car Args).
<abu[7]> ok, though conc with a single arg is meaningless
<pablo_escoberg> Right, this is for testing and understanding.
<abu[7]> yep
<pablo_escoberg> It will all be conc'ed with other things.
<pablo_escoberg> The problem comes in when I do (conc (car Args)) .  Since (car Args) is set to '(Msg)
<abu[7]> yes
<pablo_escoberg> and (conc '(Msg) gives (Msg)
<abu[7]> and (conc ''(Msg)) gives what you want
<abu[7]> see above
<pablo_escoberg> but I want (conc (car Args))
<abu[7]> conc evaluates
<pablo_escoberg> I don't have '(Msg) yet
<abu[7]> conc concatenates
<pablo_escoberg> right, so it should evalute (car Args) to '(Msg) and conc that to (Msg),
<abu[7]> (car Arg) is '(Msg) which is (quote Msg)
<pablo_escoberg> instead it gives '(Msg)
<pablo_escoberg> which is baffling to me
<abu[7]> so you conc with NIL
<pablo_escoberg> right, I'm conc'ing with nil to unquote the thing
<abu[7]> conc does not unquote
<pablo_escoberg> so I have '(Msg) in a car, and I want (Msg)
<pablo_escoberg> if I do it directly, it works
<abu[7]> then take CDR
<abu[7]> (cdr ''(Msg)) -> (Msg)
<abu[7]> same as (cdr '(quote Msg))
<pablo_escoberg> I'm really not making myself clear.  Right now what I'm looking to accomplish is simply understanding what is going on.  Why I am getting 2 different results from what looks like the same thing to me.
<pablo_escoberg> Not trying to accomplish anything else, because I can't until I understand this.
<pablo_escoberg> another way to put it:
<pablo_escoberg> what is the difference between (conc x) and (conc (car y) is (car y) yields x
<pablo_escoberg> if*
<abu[7]> What exactly is X and Y?
<abu[7]> (Msg) is a single cell
<pablo_escoberg> in this case X is '(Msg) and y is Args
<abu[7]> (quote Msg) has two cell
<abu[7]> s
<abu[7]> So X is (quote Msg)
<pablo_escoberg> as does '(Msg), right?
<abu[7]> What is Y
<pablo_escoberg> ('(Msg) (prinl Msg))
<abu[7]> '(Msg) gets EVALUATED and thus gives (Msg)
<abu[7]> (foo '(Msg))
<pablo_escoberg> but it doesn't!
<abu[7]> so foo sees just (Msg)
<pablo_escoberg> it gives '(Msg)
<pablo_escoberg> try it
<abu[7]> o
<abu[7]> No, it does
<pablo_escoberg> I keep trying it and it gives '(Msg) .  That's the whole point here.
<pablo_escoberg> it's completely nuts.
<pablo_escoberg> do me a favor, cut and past the code from the chat and see if you get the (Msg) rather than '(Msg)
<abu[7]> because you pass (car Args) which is (quote Msg) and NOT (Msg)
<pablo_escoberg> it is '(Msg)
<abu[7]> (quote Msg) *is* '(Msg)
<pablo_escoberg> right
<pablo_escoberg> so why am i getting different results????
<abu[7]> -> '(Msg)
<abu[7]> oops
<abu[7]> (conc '(quote Msg)) -> '(Msg)
<abu[7]> conc is a no-op
<abu[7]> only evaluates
<pablo_escoberg> yes, but that's not what I'm doing
<abu[7]> (conc '(Msg)) -> (Msg)
<abu[7]> It is the same
<abu[7]> Arg is irrelevant
<abu[7]> (car Args) evaluates to '(Msg)
<pablo_escoberg> YES!
<pablo_escoberg> so why does (conc (car Args)) not evaluate to the same thing???
<abu[7]> ''(Msg) *also* evaluates to '(Msg)
<abu[7]> What is different?
<abu[7]> Think about the quoting
<abu[7]> you mess that up
<pablo_escoberg> only the result.  I want (Msg) and I am getting '(Msg)
<pablo_escoberg> and it's not just what I want, it's what I expect and it's driving me nuts.
<abu[7]> conc is a no-op here
<abu[7]> forget the conc
<abu[7]> (car Args) is (quote Msg)
<pablo_escoberg> but I do need to understand this.  I am now confused about the whole evaluation process
<pablo_escoberg> right, so why doesn't it conc to (Msg) ????
<abu[7]> yes, this is the critical point
<abu[7]> forget conc!
<abu[7]> it does nothing here
<pablo_escoberg> the only reason I am stuck on conc is that it's the only thing I've seen this behavior in.
<abu[7]> (conc 'a) -> a
<pablo_escoberg> yup, that's fine.  it just doesn't work for an inderect reference, and the way I understand evaluation, it should.
<pablo_escoberg> if you want to explain using something other than conc, it's fine.
<pablo_escoberg> buy again (x y) should evaluate to the same thing as (x (car z)) if (car z) evaluates to x)
<abu[7]> Or nothing at all
<pablo_escoberg> and conc seems to violate that.
<abu[7]> no
<abu[7]> (x (car z)) depends on what x does
<abu[7]> (conc 'any) always returns any
<abu[7]> so forget it
<abu[7]> Just any
<abu[7]> (car Args) is something
<abu[7]> so (conc something) returns it
<pablo_escoberg> ok, I guess I'll drop it for now.  Seems append does what I want, but I will come back to this on my own to understand it.  Thanks again.
seninha has quit [Quit: Leaving]
<abu[7]> buw (car Args) is ''(Msg) and not '(Msg) if these three are evaluated
<abu[7]> append behaves exactly the same in this regard
seninha has joined #picolisp
<abu[7]> As I said, first make clear what you want
<pablo_escoberg> so what's the right way to unquote a list?
<abu[7]> Args is no good
<abu[7]> if you pass '(Msg) ...
<abu[7]> cause the quote has no meaning in a nonevaluating context
<abu[7]> Please check my proposal first
<abu[7]> (de opt_fun (Fun)
<abu[7]> above: http://pb1n.de/?af6a0f
<abu[7]> it quotes (opt_fun '((Msg) (prinl Msg)))
<abu[7]> because Fun is evaluated
<pablo_escoberg> I'm looking at it, and of course it's completely different and it turns out I didn't need fill after all.  Thing is, I may need to expand that argument list for a name to define class methods, so I may need a different arg signature, which is why I started with Args
<pablo_escoberg> probably not; I imagine I can define a method this way too.
<abu[7]> I still don't get what that should be useful for ;)
<pablo_escoberg> actually, shit!  I just realized, your function does something completely different, which in fact is not really useful.
<pablo_escoberg> Should have read more closely.
<pablo_escoberg> What I need is a function that takes a "lambda" as an argument.  It them adds an Ops argument to the argument list and a line processing the new Opts argument prior to executing the rest of the code
<abu[7]> Sorry, Im on my daughter's wedding party
<pablo_escoberg> go enjoy
<abu[7]> and bad network acess
<pablo_escoberg> I'll keep playing.
<abu[7]> Cannot type well
<pablo_escoberg> I had no idea or I would not have kept you!
<abu[7]> yeah, let's talk tomorrow :)
<pablo_escoberg> Congratulations, BTW!
<abu[7]> Thanks! ☺
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg> Don't reply, keep enjoying the wedding, but... solved!  http://pb1n.de/?939c16  .  Now you should be able to see what it's good for.  If not, I'll be using it now and once I have that working, I'll show you an example.
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
msavoritias has quit [Remote host closed the connection]
<pablo_escoberg> Oops, I was wrong.  Not solved.  Still playing, any questions will still wait until tomorrow.  Hope you are having a great time.
<abu[7]> Yes, very nice here :)
seninha has quit [Quit: Leaving]
<pablo_escoberg> Probably this:  http://pb1n.de/?fd5516
seninha has joined #picolisp