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
ygrek has joined #picolisp
ygrek has quit [Remote host closed the connection]
ygrek has joined #picolisp
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
geri has joined #picolisp
<geri> hey-hey, 久しぶりです
<abu[7]> Hi geri, 本当
<geri> :D
<geri> how's it going?
<abu[7]> all good
<abu[7]> and you?
<geri> found a lisp job, starting next month
<geri> so very good as well
<abu[7]> Great, congratulation!
<abu[7]> Not PicoLisp I presume ;)
<geri> thank you, thank you
<geri> yeah, its clojure
<abu[7]> oh
<abu[7]> so not really Lisp
<geri> lisp enough in my eyes to be happy about the position
<abu[7]> true
<geri> what do you typically do when you need a "structure"?
<geri> like struct point { int x; int y; }
<abu[7]> A class
<geri> oh wait xd
<abu[7]> ie a sym with properties
<geri> yeah right, i forgot they existed
<geri> thought you'd say pair encoding
<abu[7]> also a way sometimes
<abu[7]> properties *are* pairs anyway
<geri> everything is!
<abu[7]> T
<geri> :D
<abu[7]> except numbers to be exact
<geri> yeah
<geri> when using classes, can you differenciate object types?
<geri> like (point? p)
<abu[7]> Yes, with 'isa'
<geri> ohh thats great
<geri> i wrote a little thingie that lets you encode structures in lists and print them with custom syntax, but there's kind of little point to if you got oop
<geri> remind me, was there any mechanism for multimethods in pil?
<abu[7]> No, because this is a compiler issue
<geri> not necessarily, but it can be pretty slow at runtime
<abu[7]> In pil you dispatch on the args expuicitly
<abu[7]> yeah
<abu[7]> needs to interprete the args
<abu[7]> It is only syntactical sugar
<geri> dispatch on args explicitly like write a function that does what you need with cond? :D
<abu[7]> right
<abu[7]> Most pil functions do that
<abu[7]> an arg check is needed anyway
<abu[7]> for errors etc
<geri> clojure's multimethods are very cool and somewhat simple
<geri> you have a dispatch function that all arguments get fed into, resulting in some unique identifier, then you have a mapping between those identifiers and methods to call
<abu[7]> ok
<geri> gives you open extension, multiple dispatch, value dispatch, etc.
<geri> but honestly like 90% of polynorphism is single-arg anyway
<abu[7]> In Pil polymorphism is only on the type, not the following args
<geri> yeah, understandable
<abu[7]> no big thing, just different programming styles
<geri> yee
<geri> multiple dispatch is more powerful, but typically quite a bit slower and more complex
<abu[7]> yes. If the types are known at compile time, different funs are compiled
<abu[7]> otherwise it gets slow
<geri> very
<abu[7]> Lisp uses dynamic types, so often the type is not known
<abu[7]> (de f (X) (g X)) (de g (Y) (if (num? Y) ..
<geri> or you manually annotate everything, which isnt fun either
<abu[7]> annotate in which way?
<geri> like declare argument/return types
<geri> common lisp lets you do that
<abu[7]> T
<abu[7]> getting static
<geri> i honestly really like gradual typing
<geri> sounds like best of both worlds
<abu[7]> gradual?
<geri> you can have purely dynamic typing
<geri> you can also declare particular argument types, not having to declare everything
<geri> or just declare everything if you want
<abu[7]> right, but only for compiled code
<geri> static typing makes no sense in an interpreter though imo
<geri> ye
<abu[7]> de
<abu[7]> :)
<geri> also ive been thinking, is there any tutorial on writing C extensions for pil?
<abu[7]> There is one for 'native' iirc
<abu[7]> not directly extensions
<abu[7]> extensions would be PilSrc, not C
<geri> well, just C functions that operate on picolisp data
<geri> is there a tutorial for pilsrc? :D
<abu[7]> This is supported by 'native'
<abu[7]> (Lisp data I mean)
<geri> just include pico.h i guess?
<abu[7]> I mean the 'T' type
<abu[7]> T # Direct Lisp value
<abu[7]> in (doc 'native)
<geri> i mean, calling C in picolisp is understandable enough, question is about calling picolisp from C :D
<abu[7]> (doc 'lisp)
<abu[7]> More useful is the Java interface
<abu[7]> in PilBox
<geri> hmmm
<abu[7]> using reflection
<abu[7]> not possible in C
<geri> aw
<abu[7]> (java
<abu[7]> (java
<abu[7]> (java CONTEXT 'getSystemService "clipboard") # ClipboardManager
<abu[7]> 'setPrimaryClip
<abu[7]> (java "android.content.ClipData" 'newPlainText "PilBox" Str) )
<geri> thats a lot of javas
<abu[7]> yeah :)
<geri> youre pasting clipboard into "PilBox" text file?
<abu[7]> 'java' does all
<abu[7]> "PilBox" is just a marker
<abu[7]> not used by the API
<abu[7]> 'setPrimaryClip' ignores it as far as I found
<geri> wait so whats going on exactly? you're getting clipboardmanager class, calling setprimaryclip to something?
<abu[7]> (java CONTEXT 'getSystemService ) gives a ClipboardManager object
<abu[7]> Then 'setPrimaryClip' is called on that object
<abu[7]> setting Str
<abu[7]> 'newPlainText' is a static method
<abu[7]> ni "android.content.ClipData" class
<abu[7]> *in
<geri> okay
<geri> i also started writing an interpreter in forth for fun
<geri> somewhat close to getting gc working
<abu[7]> A Forth with a gc ?
<geri> no, normal forth and lisp gc written in it
<abu[7]> cool
<geri> pretty fun too
<geri> realized if you dont wanna use vip you can use (load) like in forth
<abu[7]> 'see' in Forth
<geri> what about it?
<abu[7]> pretty printing in Forth iirc
rob_w has joined #picolisp
<geri> it gives you body of a word
<abu[7]> T
<abu[7]> and prints with indentation iirc
<geri> i think so yeah
<geri> question, what am i doing wrong here? (class +Point) (dm T (X Y) (=: x X) (=: y Y)) (setq p (new '(+Point) 1 2)) (print (: x))
<geri> trying to just get a field back :D
<abu[7]> The print is not in a method
<abu[7]> (with p (print ..
<abu[7]> (should be 'P' though)
<geri> right
<geri> can you do it without "with"?
<geri> (: x P) or something
<abu[7]> It is the same as (let This P
<abu[7]> or (dm print> () (print (: x)))
<abu[7]> (print> P)
<abu[7]> Methods bind 'This' automatically
<geri> so you cant access fields directly without binding This?
<abu[7]> (get P 'x) or (; P x)
<geri> okay great
<geri> thanks
<abu[7]> This is just convenience
<abu[7]> for ':' etc
stultulo is now known as f8l
<geri> yea, great
<geri> i could try to implement persistent vectors or something with classes :D
<abu[7]> yes
<geri> very nice
<geri> i dont know how its in germany but im melting from the heat over here
<abu[7]> Here just ok
<geri> looks like the heat wave came over here
<abu[7]> 28 C max today
<abu[7]> in mid-Russia?
<geri> eastern europe :D
<abu[7]> T :)
<geri> weather forecast says its +27 at most
<geri> i feel like its lying
<geri> gonna eat breakfast and check
<abu[7]> Good, I must leave too
<abu[7]> Going to beer garden with friends :)
<geri> enjoy
<abu[7]> thanks! ☺
<abu[7]> It is called Weisswurstfrühstück
<abu[7]> Later today there is "Fridays for Functions". Not sure if anybody will show up.
<geri> yeah i read the emails, ill see if i can join
<abu[7]> 👍
<abu[7]> no stress
<geri> okay i remembered that i love polymorhism :D
<geri> iirc method calls are resolved by walking the property list of superclass and if you cant find a matching symbol you walk its superclass, no?
<abu[7]> Not properties but values
<abu[7]> list of superclasses
<geri> so in a symbol that's an object/class, value cell has a list of superclasses?
<geri> where are fields/methods stored then?
<geri> oh wait
<abu[7]> yep
<abu[7]> First methods, then superclasses
<abu[7]> assoc list of methods
<geri> okay so methods and superclasses in an alist in value
<geri> and values/properties?
<abu[7]> yes
<geri> i dont see them in value...
<abu[7]> "OO Concepts" in @doc/ref.html
<geri> how do i view property list of a symbol?
<abu[7]> The value of an object has methods and classen in the value
<abu[7]> (show Obj)
<geri> i confused show with view :(
<geri> okay great
rob_w has quit [Remote host closed the connection]
corecheckno has quit [Remote host closed the connection]
aw- has quit [Ping timeout: 272 seconds]
geri has quit [Quit: ERC 5.6.0.30.1 (IRC client for GNU Emacs 30.1)]
ygrek has joined #picolisp
beneroth has quit [Quit: Leaving]
aw- has joined #picolisp
aw- has quit [Ping timeout: 245 seconds]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Quit: WeeChat 4.6.3]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
z4k4ri4 has joined #picolisp
<z4k4ri4> set relay.network.bind_address 127.0.0.1
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Quit: WeeChat 4.6.3]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Quit: WeeChat 4.6.3]
z4k4ri4 has joined #picolisp
void_Guest96 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
void_Guest96 has quit [Quit: Client closed]
z4k4ri4 has quit [Quit: WeeChat 4.6.3]
z4k4ri4 has joined #picolisp
bjorkintosh has joined #picolisp
ygrek has quit [Remote host closed the connection]
elnegro has joined #picolisp
elnegro has left #picolisp [#picolisp]