freenode/#lisp - IRC Chatlog
Search
14:43:37
flip214
when printing compound objects, floats in there are written with too many digits; can I bind some variable (like *PRINT-LENGTH*) to change the format of floats within a block?
14:44:47
phoe
the only way I can imagine is using FORMAT with a format control argument passed via a dynamic variable
14:57:32
[d]
<jackdaniel#0000> eql seems to be more sensible, but I don't see the appropriate entry on the assoc page (neither for eq or eql)
14:57:34
[d]
<jackdaniel#0000> maybe it is settled in some normative statement for default test values
15:01:49
andreyorst`
their client supports message edits, which are simply sended to IRC as new messages with [edit] mark
15:02:27
jackdaniel
it is a bridge, note that there is a nick in these "logs" that does not appear here
16:03:51
nij
Tried cl-pdf.. but there's no doc. The examples it provide seem to be too fancy. I just want to read nice plain texts on a paper.
16:05:44
jackdaniel
(clim-pdf:with-output-to-pdf-stream (stream "/tmp/foo.pdf") (format stream "HI!~%"))
16:09:00
nij
Error: Invalid index 24039 for (SIMPLE-VECTOR 256), should be a non-negative integer below 256.
16:57:49
dim
yeah also if you target the JVM that's where you will find the greatest number of already available libs to integrate with everything that exists, I believe
16:58:16
jackdaniel
what is more bothering is that python libraries tend to work longer - that means that the joy of computing lasts longer
16:59:07
nij
mfiano: beach: .. Well we certainly don't want to write libs when it's needed as an auxialiry tools, right?
16:59:21
pranavats
nij: We deal with it by staying focused on our needs, (for which CL libraries are often enough), rather than what's fashionable.
17:00:05
jackdaniel
nij: see "section 5, performance" for the inspiration of the previous joke: https://cliki.net/Infrequently%20Asked%20Questions
17:00:40
beach
nij: No, I meant the "deal with" part. I am not sure what kind of answer you want. "We are all suicidal!"?
17:01:12
beach
nij: I think if I needed libraries more than I need the Common Lisp features that I use on a daily basis, I would probably use Python instead.
17:02:07
dim
I don't suppose you would like it beach ;-) (I have done a lot of Python over the years, and well, well... I like Common Lisp a lot)
17:03:27
jackdaniel
who would won't to limit themself to programming strictly inside the cmucl compiler package though?
17:04:46
jackdaniel
https://files.mastodon.social/media_attachments/files/105/595/091/206/086/972/original/5dc9f1e10b9b61e6.png
17:07:28
jackdaniel
it was hello, but then I had it aligned so I couldn't verify, that the flipping ink works in the middle of the single letter
17:17:13
nij
I bet someone can re-write a python implementation (in particular, its "read") in python.
17:22:35
aeth
shka_: I mean, it's not going to be a complete Python 3, and even if it is, it's not going to run any meaningful library like Tensorflow, which expects Python's particular way of calling into C/C++/Fortran
17:23:05
aeth
But you should be able to turn e.g. print("Hello world") into (python:print "Hello world")
17:23:21
aeth
And the latter is the interesting part, because now you'd be able to write a real s-expressioned Python, rather than e.g. Hy
17:24:07
aeth
nij: It would parse print("Hello world") into (python:print "Hello world") rather than directly translating it into the equivalent CL-native print/write/format because then you could use macros on the intermediate language
17:25:46
aeth
I think Hy might work on the AST of Python, but that's a low-level interpreter-specific AST used for internals
17:27:38
aeth
well, I don't quite know how it works, but in my experience, the various Lisp-like languages for non-Lisps don't really... do Lisp.
17:28:32
aeth
Although this is a lot less than you think it is because (1) Python has a GIL so there are implicit, undiscovered race conditions in the code meaning you can't multithread libraries and (2) Python is slow so there's a lot of FFI, which wouldn't be compatible
17:31:37
aeth
The way I'm going to implement non-s-expression languages (I currently only have a partial Scheme) is to essentially write an s-expression language that preserves the semantics of the language.
17:32:53
aeth
Lispy languages that compile to other languages like Lua or Python tend to do either (lisp-like-language -> source-code) or (lisp-like-language -> exposed-interpreter-AST), but you're still restricted by the semantics of the target
17:33:24
Josh_2
Basically Im trying to check if a bunch of symbols are boundp as they correspond to variable names
17:33:48
aeth
nij: What I'll be attempting is (foreign-source-code -> lisp-like-language -> Common-Lisp) which means it will have the performance characteristics of, say, SBCL and you will be able to use all of SBCL in both the compiler stage and the actual runtime.
17:34:08
aeth
nij: I'll do it on Lua, not Python, though. Lua's much, much smaller. If it works I might do Python and/or JS at some later time.
17:36:02
nij
aeth: so do you mean to write a textual translator that first translates "print("hi")" to "[print "hi"]" and then to "(print "hi")"?
17:36:32
nij
aeth: (By the way, I wonder where you can find the very definition of the lang python.)
17:36:37
Josh_2
Basically I need to construct a large plist with many key values pairs however all of the keys are optional and I want to construct the list using the &key option in λ lists
17:37:17
aeth
nij: no, it would go from print("hi") to (whatever-language:print "hi") with the caveat that various "-related syntax would be part of the reader, so e.g. "hi\nworld" would already turn the \n into a newline by the s-expression step, although a reader macro could be used to get the desired foreign behavior of " for literally writing the s-expressions
17:37:28
Josh_2
I don't want to go through and check which are bound manually, I just want to construct my list from the bound variables
17:38:32
aeth
You could go, say, Markdown string -> HTML string, but you better have a bunch of s-expressions in the intermediate or you lose the advantages of using CL
17:38:42
Josh_2
Say I have the symbol 'limit, which may or may not be bound, I need to construct a list like '("limit" <value of limit> ... )
17:40:13
Josh_2
I can maintain a list of corresponding symbols like (let ((args '(limit .. )))) and use those to check if my arguments are bound
17:40:14
White_Flame
if the keyword is not given in the function, the parameter is bound to the default, which is by default NIL
17:41:51
Josh_2
this isn't my problem though, im trying to avoid having to write something like this
17:42:01
aeth
mfiano: eh... the thing is, alexandria:make-keyword is correct, but this sort of thing should probably be inline and alexandria's isn't, so it's justifiable to reinvent the wheel here imo
17:42:37
Josh_2
(when (boundp <var>) (setf mylist (append (list <mysymbolasstring> <symbol-value>)))) about 10 times
17:43:14
White_Flame
btw, you can just append your optional changes to the head of the default plist
17:44:01
White_Flame
eg, if defaults are (:a 1 :b 2), and you prepend your change so you end up with (:b 3 :a 1 :b 2), then :a = 1 and :b = 3. the later value is overridden by the earlier value
17:50:56
Josh_2
In this case It's part of an API where you don't have to provide defaults, you just dont send the values
17:51:31
jrm
jackdaniel: Whatever you prefer. It's also not difficult for us to package the latest from master. If you could just share your plans, I'll adapt. I just wanted to make sure we were offering what you (authors) felt was best for users.
18:11:39
nij
After (slynk:create-server :port 1234 :dont-close t), how do I send code '(+ 1 1)' from my terminal to the repl? __ The DOC seems to be addressing how to connect the repl with a *remote* machine, which is even harder than my use-case. https://joaotavora.github.io/sly/#Connecting-to-a-remote-Lisp
18:15:08
pranavats
nij: Start emacs with sly loaded in your terminal. Run the command `sly-connect` and enter the correct port number.
18:17:14
White_Flame
or, you'd have to figure out the raw socket protocol and reimplement it outside of elisp
18:20:08
nij
I want to have a lisp repl running in the background, and be able to send expressions to it from another terminal.
18:57:43
[d]
<amigojapan#0000> and my son were both born by sessarian section, I wonder if it coudl be cause both me and my dad are big people and our wifes were small
19:22:17
flip214
nij: swank is supported by emacs (with slime), vim (vlime or slimv), and a few other editors.
19:22:59
flip214
it's a whole protocol, though; if you want a telnet/readline style input, a simple socket might be better.
19:23:20
flip214
or, if you have an HTTP server (hunchentoot), why not make some easy-handler for that?
19:23:50
nij
I don't know what sockets, servers, telnet.. etc really are @@ Maybe that's why I cannot understand what I got.
19:25:25
White_Flame
yeah, emacs launches sbcl, tells sbcl to listen on a network socket, then connects to that to control it. 2 separate process connected via networking
19:26:11
White_Flame
I'm sure there are examples out there of having a network-based plain text repl
19:27:17
flip214
via swank is the preferred solution ;) but that's not a plain-text protocol, but RPC.
19:27:18
Xach
nij: man 7 tcp and man 7 udp have some reference material about the underlying functinos. SBCL exposes functions by the same names to enable networking.
19:27:25
White_Flame
but there are compatibility libs that are more often used that wrap implementation specifics
19:40:35
White_Flame
a valid but lamer approach that avoids learning networking (it's complex if you've never done it, in any language) would be for the daemon lisp to just scan for some file, and read/eval it if one appears
19:40:54
White_Flame
with your keybindings writing a small trigger file containing what you want to run
19:43:31
Xach
You won't fail! It just might take a while. And there are other options that might get you somewhere interesting quickly while still leaving time to learn more things.
19:46:12
White_Flame
the biggest thing that messes people up when doing TCP (the stream form of networking, most common), is that when you receive bytes from the stream, it may not be an entire message at once, but some overlapping part
19:46:32
White_Flame
other than that, it's just getting the listeners & per-connection stuff organized
19:47:03
White_Flame
I think that usocket is one of the more popular libraries for running the networking for you, and has examples
19:47:29
White_Flame
I mean the packet could overlap between 2 messages that the other side sent from its code perspective
19:47:40
Xach
if the remote end sends "ABC", you may get "A" or "AB" or "ABC", but not "AABC" or "AB" "BC"
19:47:53
White_Flame
the packet overlaps the individual message data chunks you sent per output call on the other side
19:49:35
White_Flame
nij: "trivial-sockets is a trivial networking library for undemanding Internet applications (for example "scripting" and interactive use)."
19:53:42
nij
I understand that there are four things to be considered: server's addr+port and client's addr+port.
20:08:49
nij
White_Flame: I'm trying trivial-sockets. Currently running the loop: https://bpa.st/VLBUE provided in the example usage.
20:09:14
nij
Does this mean that my sbcl repl has opened a socket that awaits any message from the outside?
20:12:01
White_Flame
note that that example doesn't do anything with the read-line return value, so your shell typing is ignored, besides the fact that there's a line
20:12:56
White_Flame
there's no loop in the example. once it exits the with-open-stream scope, that closes it from teh lisp side
20:18:20
White_Flame
the fact that the example had a string in its current form muddled it slightly :)
20:31:21
jackdaniel
I want to note, that I was only addressing what White_Flame wrote (I did not try to answer any question)
20:32:22
White_Flame
but nice output formatting, and capturing errors, and lots of other things quickly get away from a small literal (l(p(e(r str)))) body
21:00:58
phoe
I've seen it burp out unrelated lines three times now, each time with that spammy edit line right afterwards
22:27:53
jrm
jackdaniel: I just updated the package to the latest master-branch commit. https://svnweb.freebsd.org/ports?view=revision&revision=562613
22:28:19
brandflake11
Hey all, can you move your ~/quicklisp and ~/.sbclrc to another computer and it work seamlessly?
22:46:30
waleee-cl
do the instructions from http://joaotavora.github.io/sly/#Loading-Slynk-faster (specifically for the "slynk core") work? I've tried having the core in both implicit paths and specifiying an absolute path, but I get polling errors when starting sly either way
23:15:02
charles`
how is there infinitely many? Do types (not classes) not actually use inheritance?
23:16:16
Bike
types just represent sets. (member 4 5 6) is the type of numbers that are 4 or 5 or 6. you can always augment a type with OR and MEMBER and stuff. so no, they don't involve inheritance per se.
23:27:18
charles`
I see, then how would I get a list of super-classes (of a class) in a portable way?
23:29:12
alandipert
typep seems like the ultimate method specializer, i wonder why there's only eql. perf?
23:30:14
alandipert
hm, i suppose also the infinitude of the type relationships might make method selection too ambiguous
23:37:43
Bike
alandipert: that's the problem, yes. classes are linearly ordered into class precedence lists, so it's easy to see which methods are more specialized than others.
23:38:39
Bike
for example if you had a method specialized on (member :a :b) and another on (member :b :c) and you called it with :b it would not be obvious what is called.
23:41:51
Bike
you can't have two distinct methods that have the same qualifiers and the same specializers.
1:05:18
nij
It's nice to be able to define printing function for cl-structs. However, sometimes I want to see its raw presentation (record-like). Can I temporarily disable the printing function?