slyrus_ has quit [Remote host closed the connection]
zaquest has joined #lisp
zulu-inuoe has joined #lisp
mindCrime_ has joined #lisp
slyrus_ has joined #lisp
<mister_m>
using slime, is there a way to recompile a function in a manner like C-c C-c, but with `(declare (optimize debug))`? I can add that to the function and recompile as normal, but I am wondering if slime can do this for me.
<no-defun-allowed>
I think C-u C-c C-c will compile with debug optimisations.
<no-defun-allowed>
See the documentation (i.e. when in a Lisp buffer, type C-h k C-c C-c): "With (positive) prefix argument the form is compiled with maximal debug settings (‘C-u’). With negative prefix argument it is compiled for speed (‘M--’)."
<mister_m>
thanks no-defun-allowed
shifty has quit [Ping timeout: 252 seconds]
shifty has joined #lisp
pbaille has joined #lisp
attila_lendvai_ has quit [Ping timeout: 252 seconds]
<Xach>
I didn't know about M--, that's cool
pbaille has quit [Ping timeout: 240 seconds]
<Xach>
(I wrote the original C-u thing long ago)
epony has joined #lisp
dukester has joined #lisp
irc_user has joined #lisp
Lord_Nightmare has joined #lisp
<mister_m>
I didn't even realize the "universal argument" C-u existed
<mister_m>
cool
DHARMAKAYA has quit [Quit: Turning off a portion of this simulation.]
aartaka_d has quit [Ping timeout: 265 seconds]
monolithic has quit [Remote host closed the connection]
nij has joined #lisp
slyrus_ has quit [Remote host closed the connection]
rumbler31 has joined #lisp
gumman has quit [Read error: Connection reset by peer]
<nij>
minion: memo for theothornhill: I've read the log again.. and I melted. Thanks so much :-D Let me know if I can help any.. (beware i'm just a noob)!
<minion>
Remembered. I'll tell theothornhill when he/she/it next speaks.
<nij>
minion: memo for beach: Good news from theothornhill! Seems like UltraSpec is going to come back alive :-D
<minion>
Remembered. I'll tell beach when he/she/it next speaks.
pbaille has quit [Ping timeout: 260 seconds]
mathrick has joined #lisp
mathrick_ has quit [Read error: Connection reset by peer]
zulu-inuoe has quit [Read error: Connection reset by peer]
Lord_Nightmare has joined #lisp
dukester has joined #lisp
akoana has quit [Quit: leaving]
bitmapper has quit [Quit: Connection closed for inactivity]
LispSporks has quit [Ping timeout: 276 seconds]
mindCrime_ has quit [Ping timeout: 268 seconds]
mindCrime_ has joined #lisp
jeosol has quit [Quit: Connection closed]
tessier has joined #lisp
tessier has joined #lisp
tessier has quit [Changing host]
skapate has joined #lisp
skapata has quit [Ping timeout: 260 seconds]
rumbler31 has quit [Remote host closed the connection]
<minion>
beach, memo from nij: Good news from theothornhill! Seems like UltraSpec is going to come back alive :-D
<beach>
Good morning everyone!
White_Flame has quit [Ping timeout: 268 seconds]
ebrasca has quit [Remote host closed the connection]
White_Flame has joined #lisp
pbaille has joined #lisp
mindCrime_ has quit [Ping timeout: 240 seconds]
pbaille has quit [Ping timeout: 240 seconds]
semz has quit [Ping timeout: 250 seconds]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
remby96 has joined #lisp
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
nij has quit [Quit: ERC (IRC client for Emacs 27.2)]
dukester has left #lisp ["Leaving"]
klltkr has joined #lisp
klltkr has quit [Client Quit]
Spawns_Carpeting has quit [Ping timeout: 240 seconds]
nij has joined #lisp
<nij>
sp
<nij>
(oops)
<nij>
How is an ffi designed? In particular, if I want to call a foreign abstract object (and play with it) in lisp, what should I do? Must I write a wrapper that models the foreign object in terms of a lisp object? Are there some known cases that won't work in lisp?
Spawns_Carpeting has joined #lisp
<remby96>
just need the map the calling conventions to what ever language you want right?
<jcowan>
THere are two ways to do it: write the C (or Blub) function using a specific signature that Lisp uses, or write a Lisp function that provides a C signature. In other words, either weird C glue or weird Lisp glue.
<nij>
remby96: what do you mean?
orivej has quit [Ping timeout: 246 seconds]
<nij>
jcowan: it's not just for C.. i'm thinking for all kinds of foreign lang.
<moon-child>
most languages that are willing to speak to other languages do so using the c abi
pbaille has joined #lisp
<nij>
how about those that are non-willing?
<moon-child>
the primary exception being java, and there is abcl
<White_Flame>
FFIs are pretty complicated, in terms of GC walking the stack and knowing what's lisp vs C (or other), as well as needing native pointers & allocations represented in with lisp tagged values
<moon-child>
c++ abi has been implemented by non-c++ compilers twice as far as I know (d and raku). Both implementations are incomplete. C++ abi is huge and horrible. That's not a road you want to go down
<White_Flame>
then there's interaction with threads, too, and all sorts of balls of wax
<moon-child>
other compiled languages tend not to have stable abis
<nij>
instead - learn the lang and write in terms of it.. it makes life easier?
<remby96>
moon-child any idea why not?
<White_Flame>
you asked how it's _designed_. feel free to use them. don't try to design them as some introductory project
<nij>
Very interesting.. I wonder why languages are so hard to translate.. even in the realm of computer science.
<remby96>
popular languages reflect industry more I think
<White_Flame>
every language has its own notion of memory allocation, how strings are structured, etc
<moon-child>
most languages' semantics are generally incommensurable
<moon-child>
appearances notwithstanding
<White_Flame>
their ABIs are tailored to the strengths of the language
<moon-child>
even languages with very similar type systems, like lua and js, you would probably run into trouble with
pbaille has quit [Ping timeout: 260 seconds]
<remby96>
makes me wonder how graal works now
<White_Flame>
they have a single ur-language underneath that everything compiles to, afaik
<White_Flame>
and then the various languages share compiler infrastructure
<White_Flame>
so nothing is truly foreign there
<loli>
IRs/Abstract machines are rather nice at that
<moon-child>
remby96: _compiling_ one language to another isn't difficult. What's difficult is retaining the language-level semantics and type system as you do so in a way that makes interoperation practical
Nilby has joined #lisp
<remby96>
ah I see
<nij>
right
<nij>
i see. thanks :)
<White_Flame>
and what's difficult is sharing a single process address space with a different language's running binary stuff
<loli>
The type theory bit shouldn't be too bad, you are taking one formal mathematical system and compiling it to a stronger or weaker one. Idris, and Agda both compile down to Haskell this way
<loli>
Haskell and other languages compile down to eventually remove their type theory, or compile it down to an IR with weaker type theory
<White_Flame>
in fact, on the symbolics lisp machines, they had a C compiler that generated lisp processor machine code and played nicely with the system (if slow)
<nij>
> moon-child: "What's difficult is retaining the language-level semantics and type system as you do so in a way that makes interoperation practical" ;; <= this!
Guester8 has joined #lisp
CrashTestDummy2 has joined #lisp
<loli>
there is interesting research with graded model types, where you can get a system F system out of it, so you could program in such a system and use languages with type systems in System F, or export to them in this way
<saturn2>
C programs on the lisp machine created a lisp byte-vector to function as the C program's "memory"
<White_Flame>
yep, and it didn't have a native char*
<loli>
where the C programs a subset of C on those lisp machines?
<moon-child>
loli: interesting, have a link to that?
CrashTestDummy3 has quit [Ping timeout: 240 seconds]
<loli>
moon-child: I'd have to drudge that up, but it comes out of better way to do QTT (think linear types on steroids)
<pyc>
Is it possible to do string interpolation within format using variable names, e.g. something along the lines of (format t "hello, {{name}}") ?
<no-defun-allowed>
The CL-INTERPOL library lets you do that.
<loli>
does CL-INTERPOL change the " reader macro, or does it define a custom define function?
<no-defun-allowed>
It is #?"hello, ${name}" but it's the same general concept.
<loli>
a custom format8
<no-defun-allowed>
It defines a #? reader macro.
<pyc>
thanks!
<no-defun-allowed>
I heard that they could run TeX on a Lisp machine using the C implementation, so it probably worked well enough.
<no-defun-allowed>
...though TeX is written in literate Pascal, and a conversion program generates the C code.
<loli>
why the conversion, do more systems just run C, or is it due to performance or maintainability concerns?
<no-defun-allowed>
Yeah, there are more systems with C compilers than Pascal - Lisp machines had both though.
<loli>
Is there a lot of literature on the Lisp machine, it seems a lot of that knowledge was lost with time
narimiran has joined #lisp
pbaille has joined #lisp
<remby96>
yeah I think pretty much everything supports the cabi
PuercoPop has joined #lisp
PuercoPop has quit [Client Quit]
pbaille has quit [Ping timeout: 240 seconds]
pbaille has joined #lisp
Oladon has quit [Quit: Leaving.]
rumbler31 has joined #lisp
<beach>
loli: I think it is fairly well documented.
<phoe>
good morning
<beach>
Hello phoe.
rumbler31 has quit [Ping timeout: 246 seconds]
<phoe>
hey hi
<White_Flame>
as far as symbolics goes, there's a lot of scans of both manuals & internal documents that are online now
<White_Flame>
there's no complete description of everything from the ground up, though, especially in terms of making a bootable image from scratch
<White_Flame>
not sure about LMI's stuff or others
<loli>
I guess i haven't been looking too hard then. I've found image literature lacking in general. Factor and MIT Scheme have some bits, but not much besides that
<remby96>
there was some website that had a lot ... I had to use it to get some info on the ibm 7094
sernamar has quit [Quit: ERC (IRC client for Emacs 26.1)]
testuser has joined #lisp
testuser has quit [Client Quit]
pve has quit [Ping timeout: 265 seconds]
pve has joined #lisp
mhd2018 has joined #lisp
catalinbostan has joined #lisp
theothornhill has joined #lisp
elflng has quit [Ping timeout: 252 seconds]
elflng has joined #lisp
OlCe has joined #lisp
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 240 seconds]
CrashTestDummy3 has joined #lisp
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
jeosol has quit [Quit: Connection closed]
swamps has quit [Quit: EXIT]
undvrainbowvita8 has joined #lisp
ljavorsk has joined #lisp
pbaille has quit [Quit: Leaving...]
mhd2018 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
varjag has joined #lisp
jeosol has joined #lisp
rumbler31 has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
hendursa1 has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Ping timeout: 252 seconds]
jeosol has quit [Ping timeout: 240 seconds]
jeosol has joined #lisp
aartaka has joined #lisp
aartaka_d has joined #lisp
Oddity has quit [Ping timeout: 240 seconds]
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 260 seconds]
actuallybatman has quit [Ping timeout: 240 seconds]
Oddity has joined #lisp
lotuseater has joined #lisp
shifty has quit [Ping timeout: 260 seconds]
<beach>
theothornhill: Got your message! That's great news!
shifty has joined #lisp
attila_lendvai_ has joined #lisp
<theothornhill>
beach: Great - yeah!
<minion>
theothornhill, memo from nij: I've read the log again.. and I melted. Thanks so much :-D Let me know if I can help any.. (beware i'm just a noob)!
leo_song has quit [Read error: Connection reset by peer]
<theothornhill>
nij: I'm sure I'll need a lot of help down the line. I'll try to set up some infrastructure. My general goal would be to make it as collaborative as possible, since making a single source of truth shouldn't happen again.
<beach>
Beware of giving just anyone arbitrary access though.
Colleen has quit [Ping timeout: 246 seconds]
shifty has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
Colleen has joined #lisp
orivej has joined #lisp
arcontethegreat[ has quit [Quit: Idle for 30+ days]
<theothornhill>
beach: yeah
leo_song has joined #lisp
drl has joined #lisp
catalinbostan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cracauer` has joined #lisp
cracauer has quit [Read error: Connection reset by peer]
catalinbostan has joined #lisp
random-nick has joined #lisp
<pyc>
Is (let ((solutions nil) (metadata nil)) ...) a common coding style? Or do you prefer to write (let (solutions metadata) ...)
<no-defun-allowed>
Yes, the latter makes it look like SOLUTIONS and METADATA are not set to interesting values.
<beach>
pyc: More explicitly, the first means that you initialize those to some default values, or possibly to Boolean false.
<beach>
pyc: The second means that you intend to assign to them before you use them.
supercoven has joined #lisp
<pyc>
thanks no-defun-allowed , beach
<splittist>
pyc: to indicate that SOLUTIONS is an initially empty list, you'd say ...((solutions '())...
drl has quit [Quit: Leaving]
theBlackDragon has quit [Quit: Boom.]
<beach>
Right.
mindCrime_ has joined #lisp
mindCrime_ has quit [Ping timeout: 240 seconds]
catalinbostan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
catalinbostan has joined #lisp
<phoe>
theothornhill: let's talk after the ELS
<theothornhill>
phoe: anytime
<phoe>
<3
orivej has quit [Ping timeout: 240 seconds]
attila_lendvai_ has quit [Ping timeout: 252 seconds]
<lotuseater>
maybe a dumb question again, what does ELS stand for?
<beach>
European Lisp Symposium
<no-defun-allowed>
minion: what does ELS stand for?
<minion>
Epigenous Limnimeter Schlenter
<lotuseater>
ah
<lotuseater>
no-defun-allowed: did you expect that? ^^
andreyorst[m] has joined #lisp
<no-defun-allowed>
I know minion comes up with something, but never what.
<_death>
minion: what does SBCL stand for?
<minion>
Sloppage Bepelt Common Lisp
<no-defun-allowed>
minion: what does SICL stand for?
<minion>
Soldado Interparoxysmal Common Lisp
amb007 has quit [Read error: Connection reset by peer]
trokotech has quit [Ping timeout: 265 seconds]
<no-defun-allowed>
Following a test in private messages, I think the -CL suffix → Common Lisp rule isn't random.
amb007 has joined #lisp
<beach>
That's right.
<beach>
lotuseater: ELS is currently the only international Lisp forum. There used to be an International Lisp Conference, it it might happen again, organized by the ALU (Association of Lisp Users). But I think the ALU is having problems recruiting (unpaid) staff.
frost-lab has quit [Quit: Connection closed]
<beach>
lotuseater: It doesn't matter much if there is one or two, nor what they are called. The only potentially problematic thing about the current situation is that ELS is always held in Europe, when it is a physical gathering. So people from other parts of the world are always the ones who have to travel far.
<beach>
lotuseater: But ELS (when it is in a physical place) has regular participants from Japan, USA, etc.
* beach
now suspects this was way more information than what lotuseater has in mind.
<lotuseater>
no thank you :)
<nij>
Ah ELS is happening.. these two days are the two most busiest in this semester.. :-( it will be uploaded later?
<phoe>
yes
plisp2 has quit [Ping timeout: 260 seconds]
<lotuseater>
and yes, i downloaded some pdfs from the last years and last year saw your some older talk about LOOP beach
<beach>
I guess a conference held in North America would have most participants take a flight, whereas in Europe, there are these things known as "trains", so it is probably better for the environment to hold conferences in Europe.
<beach>
lotuseater: Oh, OK. That one was a few years back. :)
<nij>
Oh there are lots of historical data available :D! I will have to binge them soon.
<nij>
beach: probably the best for environment if it's held on twitch
<beach>
That's not the only consideration though.
<nij>
By the way.. why do the keynote talks seem unrelated to lisp to me? i'm too noobie?
<phoe>
nij: the first keynote was actually about Lisp in practice!
<phoe>
live and interactive programming using Lisp, interacting with music generators or video presentations or robots
<nij>
mmmhm that one seems closer to lisp, at least "symbolic" is used in the topic
<lotuseater>
or debugging satellites from far away? :D
theothornhill has quit [Ping timeout: 265 seconds]
paul0 has quit [Quit: Leaving]
vegansbane6963 has joined #lisp
<nij>
It's done?
<nij>
Btw, is there a way to get the place of a nested object? Something like
<jmercouris>
nij: something like...?
<jmercouris>
I'm here on the edge of my seat
<nij>
(setf (get-nested (nij pants pocket wallet note content)) "Do this do that")
<phoe>
sounds like a use case for alexandria:compose
<nij>
jmercouris: it took me time to balance the parens..
<jackdaniel>
you may need to define a setf expander for that
<nij>
phoe: oh? How do you d othat!?
<jmercouris>
defmethod setf
<no-defun-allowed>
I wonder if (setf (arbitrary-arrows-library:-> nij pants pocket wallet note content) "Do this do that") works.
<nij>
jackdaniel: i dunno maybe some macro suffices.
<phoe>
it should work!
<phoe>
no-defun-allowed: binding-arrows should work, I've paid attention to define setf expanders that should work
<nij>
phoe: how?!?!
<lotuseater>
when I updated my quicklisp I saw now there is also ALEXANDRIA-2 o.O
<jmercouris>
WHAT? another Alexandria?
<jmercouris>
This cannot be
<jmercouris>
What is the remote for this?
<jackdaniel>
it is the same alexandria
<phoe>
alexandria-2 is defined by alexandria
<jackdaniel>
but it has another package
<jmercouris>
an extension?
<lotuseater>
don't know, but seems to have the same set of symbols
<phoe>
just for new symbols that cannot be added to the old alexandria package
<jackdaniel>
to not break existing libraries by i.e adding a new symbol
<jmercouris>
very conservative.
<lotuseater>
ah :)
<jmercouris>
what kinds of symbols cannot be added?
<phoe>
any
<jmercouris>
are there people :USEing Alexandria or something?
<phoe>
yes
<phoe>
tons of them
<jmercouris>
Ay yai yai!
<jmercouris>
Dangerous!
<lotuseater>
hm i thought :IMPORT-FROM is better
<jmercouris>
It definitely is
<jmercouris>
you should only :USE internal packages in my opinion
<no-defun-allowed>
Yes, arrows work.
<nij>
no-defun-allowed: hmm your method works? To get the content of note, we need (getf note 'content)?
catalinbostan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<no-defun-allowed>
Some parts elided: (setf (arrows:-> *hayley* pocket note) "Test this code") *hayley* ⇒ #S(PERSON :POCKET #S(PAPER :NOTE "Test this code"))
<no-defun-allowed>
GETF?
<nij>
So a level above is (getf (getf pocket 'note) 'content')
<jackdaniel>
lotuseater: adding a nickname for the package and not importing anything is even better
<jackdaniel>
i.e (a:ensure-list …) seems to be concise
<jmercouris>
makes refactoring easier
<_death>
nij: there are libraries for that, like "access".. or you could just write your own.. but I think this pointer chasing is not a good sign.. check out Law of Demeter
<no-defun-allowed>
The elided part was precisely (defstruct (person (:conc-name "")) pocket) (defstruct (paper (:conc-name "")) note) (defvar *hayley* (make-person :pocket (make-paper :note "")))
<jmercouris>
I agree with Mr. Kochmanski
<no-defun-allowed>
You're set if the accessors are actual functions, as in the arrow example.
<nij>
phoe in your example, it doesn't make sense to call golden-utils:a:alist-get, right?
<lotuseater>
ah with local-nicknames
<nij>
And it wouldn't make sense to make it make sense?
<nij>
I wonder why CL doesn't support nested name space.. something like a:b:c:d:alist-get
<no-defun-allowed>
Crikey, even the README for ACCESS shows off bad programming style, butchering the values of unexported symbols and slots.
shifty has quit [Ping timeout: 265 seconds]
<no-defun-allowed>
"It should however allow you to prototype more rapidly and change the backing data stores without having to change their access (ie I can switch from a plist to an alist and everything will continue to work)"
<no-defun-allowed>
Let me tell you about DEFUN...
shifty has joined #lisp
<nij>
uh..
<no-defun-allowed>
Yes, it is allowed this time.
Krystof has joined #lisp
<_death>
there are libraries in other languages that do similar things, like lens (haskell) or specter (clojure).. but again, I think it's suspect
<pyc>
Is there no standard library function to do what (getf *map* (intern (string-upcase key) :keyword))) does, i.e. given a key as a string, look that up in plist and return its value?
<pyc>
that makes me think if I am misusing plist. perhaps plist is not meant for lookups where my lookup key is a string?
<_death>
pyc: interning should usually not be done willy-nilly.. sometimes a hash table mapping strings to whatever will do
<pyc>
My *map* is a quoted plist that has configuration data. It plays the role of what JSON or YAML might play in another language. Is it possible to create a hash as a literal in CL? With plist I have the advantage that I can create it as a single literal (quoted plist, e.g., '((:name "harry" :age 20) (:name "sally" :age 21) ...)
<_death>
pyc: for a single plist, there's alexandria:plist-hash-table.. you can always write a small function to translate from a form with nice syntax to whatever representation
theBlackDragon has joined #lisp
<nij>
so.. is access (cl) bad style? it's hard for newb to tell us cl stuff are usually under documented
orivej has quit [Ping timeout: 260 seconds]
<pyc>
_death: thanks. let me revisit Practical Common Lisp. I think it has an example of what I am trying to do in its 2nd chapter (a simple database). The author did it without using any external lib, so it may have something helpful for my situation.
<_death>
pyc: sure, you can easily write plist-hash-table.. I just gave a reference so you can look it up
<pyc>
okay, let me read alexandria code too
<no-defun-allowed>
Very much so - if you want to get at or set some value in an object, then you should define an accessor function. That makes it actually possible to replace the representation, and to read e.g. (pocket nij) instead of (getf nij 'pocket).
<no-defun-allowed>
And then POCKET can signal an error if the input is malformed, whereas (getf '() 'pocket) would return NIL and the error would be blamed on another function.
kevingal has joined #lisp
kevingal has quit [Read error: Connection reset by peer]
<pyc>
_death: Do you have an opinion on this way of solving the problem: (defvar *map* '(:a "apple" :b "ball")) (getf *map* (find-symbol (string-upcase "a") "KEYWORD")) ?
shifty has quit [Ping timeout: 268 seconds]
<_death>
pyc: when I need to translate from "external" strings to a fixed set of keywords, I don't use something as general as find-symbol
Krystof has quit [Read error: Connection reset by peer]
raeda has quit [Quit: Leaving]
Krystof has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
hypercube has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
saganman has left #lisp ["Leaving"]
amb007 has joined #lisp
rodriga has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
irc_user has quit [Quit: Connection closed for inactivity]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
theothornhill has joined #lisp
jeosol has quit [Ping timeout: 240 seconds]
<engblom>
I have a long string with line-feed (so actually several lines of text). Now I need to find the first word on the line containing a string I searching for. Are there any ready functions I can use for this?
<engblom>
So what I basically would use |grep and |cut in shell for.
<flip214>
engblom: there are string-trim functions to remove whitespace. If you like regular expressions, there's a library CL-PPCRE.
<beach>
engblom: I would probably start by splitting the string using SPLIT-SEQUENCE (library). Then I would use SEARCH to determine whether the substring is present. Finally, I would use SUBSEQ to extract the string you want.
johnjay has quit [Ping timeout: 240 seconds]
johnjay has joined #lisp
klltkr has joined #lisp
<pjb>
engblom: yes: (let* ((pos (search target text)) (bol (position #\linefeed text :end pos :from-end t))) (subseq text bol (position-if-not (function alpha-char-p) text :start bol)))
<beach>
Nice!
<engblom>
I am trying to use (string-trim '(#\Space #\Tab #\Newline) " ... a string with extra spaces and line feeds ...") but for some reason it does not trim anything.
<pjb>
engblom: note: there are two ASCII control codes: Carriage Return CR = 13, and Line Feed LF = 10. They are used to indicate new lines: CR alone on Macintosh, CR LF on MS-DOS and MS-Windows, LF alone on unix systems. Common Lisp abstract this away, by defining a #\newline character that is normally used to separate lines.
<pjb>
engblom: now, it is possible that a given implementation uses (eql #\newline #\return) or (eq #\newline #\linefeed) (or some other characters, for example, in ISO-8859-1 there's a NEL control code, and in unicode there are several code points that can be used.
<pjb>
engblom: so you said linefeed, so I used ~C to insert a line feed in the string.
<pjb>
engblom: but you probably meant a newline, and then ~% could be used with format or a literal new line could be inserted in a multi-line string literal.
<pjb>
engblom: note that only #\space, and #\newline are standard character names. The other non-graphic character names #\rubout #\page #\tab #\backspace #\return #\linefeed are only semi-standard: they may not exist if the implementation doesn't have the codes representing them. For example, in EBCDIC, some of them wouldn't exist (on the other hand, EBCDIC has a NEL code too, for a direct mapping to #\newline).
<pjb>
So my code above, using #\linefeed, is not conforming: on an implementation without #\linefeed, it would fail.
<pjb>
I should have written something like #+has-line-feed #\linefeed #-has-line-feed #\newline perhaps?
<engblom>
I tried it, but sadly it fails: it gives an empty string in my case. I wonder if it is because of the linefeed being strange. When I use print on the string it puts ^M where the linefeeds are.
<engblom>
Also, somtimes there is extra whitespace before the first word.
<beach>
You must be using some weird OS, like Windows or something like that.
<engblom>
beach: Nope, but this is information fetched through telnet out of some network equipment.
<splittist>
EBCDIC performs two vital functions: (a) keeping IBM's Big Iron functioning into its nth decade; and (b) giving CL language lawyers something to talk about.
<beach>
engblom: I think you really need to take the two or more suggestions and experiment with them. It is hard to give you all the details for all the variations of the problem here on IRC.
<engblom>
Yes, I will have to experiment myself. The strange thing is that split-sequence with #\Linefeed works well.
andreyorst[m] has quit [Ping timeout: 246 seconds]
cage_ has joined #lisp
<engblom>
It is probably using linefeed + carrige return.
<pjb>
engblom: engblom it's improbable that your lisp strings contain both return and linefeed. Usually they're converted into a newline when reading, and converted back when writing.
<pjb>
engblom: note that ^M is not linefeed, it's carriage return!
<pjb>
If your string contains them I would suggest 1- select the right :external-format to avoid reading them. 2- removing them from your string (if you have newlines with them), or 3- replace them with newlines.
<pjb>
telnet, like most internet protocols, uses CR LF.
<pjb>
If you receive the data in binary and convert it to strings, then you need to handle the 13 10 bytes yourself and replace them with a #\newline character.
<jcowan>
White_Flame: Vacietis is a C compiler in the style of the Lisp Machine C compiler.
mrchampion has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
<engblom>
pjb: Thank you, I will try to remove them from the string
<pjb>
engblom: or just use com.informatimago.common-lisp.cesarum.ascii:ascii-string https://termbin.com/x9bv2
aggin has joined #lisp
aggin has quit [Client Quit]
wsinatra has joined #lisp
brownxoat has quit [Quit: Connection closed for inactivity]
scm has joined #lisp
theothornhill has quit [Ping timeout: 240 seconds]
kevingal has joined #lisp
Inline has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
Inline has quit [Client Quit]
Inline has joined #lisp
ebrasca has joined #lisp
thomasb06 has joined #lisp
koolkat332 has joined #lisp
jeosol has joined #lisp
skapata has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
cage_ has quit [Quit: Leaving]
v88m has joined #lisp
srhm has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
brandflake11 has joined #lisp
CrashTestDummy3 has quit [Read error: Connection reset by peer]
CrashTestDummy3 has joined #lisp
theothornhill has joined #lisp
renzhi has quit [Ping timeout: 250 seconds]
<lukego>
hey are the lightning demo slots all booked for ELS tomorrow? if there's space I could do a couple of minutes' demo of my SLIME backend for McCLIM. This is a new project that I'm hoping to finish and ship quickly.
koolkat332 has quit [Ping timeout: 240 seconds]
yitzi has joined #lisp
<beach>
Ask in #elsconf.
<lukego>
I'll wait for a lull e.g. tonight
<lukego>
(thanks)
<jeosol>
beach: are you here?
imode has joined #lisp
<beach>
I am.
<jeosol>
Good references to your work that aided implementations of CLOS related functionality in several implementations; Congrats
andreyor1 has quit [Remote host closed the connection]
<jeosol>
I think you are probably listening to the discussion now
<jeosol>
Very nice
renzhi has joined #lisp
<beach>
Thanks.
nature has joined #lisp
<jeosol>
I don't recall which particular one that Chris said, not a compiler guy
shifty has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
ghard has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
aeth has quit [Ping timeout: 252 seconds]
ilshad has joined #lisp
nij has quit [Quit: ERC (IRC client for Emacs 27.2)]
<brandflake11>
Hello all, there is a small function I am working on that is not making sense to me. I think it stems from my understanding of how variables work inside DEFUN and LOOP. Would anyone be interested in looking at the code?: https://pastebin.com/TMNvKvc7
<brandflake11>
I can explain more too if needed
aeth has joined #lisp
<beach>
My addblocker doesn't allow me to view it.
<beach>
Could you use tymoon.eu/plaster instead.
<ChoHag>
Your ad blocker tells you what to do?
<brandflake11>
beach: Sure, I can do that!
<ChoHag>
Or do you just mean pastebin.com is crap? :P
<beach>
pastebin encourages me to disable my addblocker.
theothornhill has quit [Remote host closed the connection]
<ChoHag>
(It's ad btw, they don't block maths...)
<brandflake11>
beach: Wait, tymoon.eu/plaster leads me to a blog website
<Bike>
x will still be a list of one element at the end.
<Bike>
It's just that that element is itself a list.
<brandflake11>
Bike: Interesting. It works with this: (defparameter listy '(nil)) and then (push 1 (nth 0 listy))
booaa has joined #lisp
<Bike>
No, it doesn't. Try doing (push 2 (nth 0 *listy*)) afterwards. You again end up with a list of one element.
<Bike>
*listy* => ((2 1))
<Bike>
What you probably want to do in your code is bind loop-list to nil instead of '(nil), and do (push loop-var loop-list) instead of the nth. Why are you doing the nth?
<brandflake11>
Bike: If I run (push 2 (nth 0 *listy*)) multiple times, I do get '(2 2 2 1).
<Bike>
No, you don't. Look at the value of *listy*. Type *listy* into your repl and see what its value is.
<Bike>
PUSH returns the new list, i.e. _the element of *listy* that you pushed to_, rather than *listy* itself.
<brandflake11>
Bike: It's this: ((2 2 2 2 2 1))
<Bike>
Yes. A list of one element.
<Bike>
(length *listy*) => 1
<brandflake11>
Bike: Oh, I see
<splittist>
brandflake11: although people say you stop seeing the parens after you get used to lisp, but they're still important (: (nil) is different from () (= nil )
<brandflake11>
Bike: I didn't know you could just do (push loop-var loop-list)
<Bike>
(push x y) = (setf y (cons x y)), basically
<splittist>
brandflake11: try macroexpanding
<Bike>
so you can push to anything that is a modifiable place, and variables are places
OlCe has quit [Remote host closed the connection]
waleee-cl has joined #lisp
OlCe has joined #lisp
<Bike>
other things in your code... it still doesn't work with the fix i suggest, because the last length is not pushed; you probably want a finally clause in there
<splittist>
lukego: Soon we
<splittist>
'll be able to run Second Climacs inside Emacs (:
<Bike>
ip-list doesn't need to print. Actually, you don't need a list at all. You can just do (loop for i across ip-address ...) and it will iterate through the characters of the string directly.
slyrus_ has joined #lisp
<Bike>
maybe you just put in the print for debugging though.
<brandflake11>
Bike: Thank you for your suggestions. I will play around with these and see what I can come up with.
<lukego>
splittist: with Drei for command input editing? :-)
gigetoo has quit [Ping timeout: 240 seconds]
<Bike>
good luck
<brandflake11>
Bike: Thanks! I am still learning lisp, so some things are still a bit fuzzy for me, so it's so great to be able to discuss why certain things happen.
<Bike>
mhm. i am happy to help. there is also a newbies channel though i don't remember the name. #clschool maybe
<beach>
Yes.
<brandflake11>
Bike: I'll check that out then. I wasn't aware of it.
<beach>
Bike: Thanks for taking care of that. I meant to help, but then it turns out I was way too tired after a long day to be of any help.
<Bike>
no problem
theothornhill has joined #lisp
theothornhill has quit [Ping timeout: 260 seconds]
mindCrime_ has joined #lisp
slyrus_ has quit [Remote host closed the connection]
thomasb06 has quit [Remote host closed the connection]
nij has joined #lisp
choegusung has joined #lisp
choegusung has quit [Client Quit]
ukari has quit [Remote host closed the connection]
<splittist>
Anyone have a suggestion for a good but simple custom reader macro to look at? My undernumber implementation isn't quite right, and I'm not sure why.
<splittist>
123456 with natural breaks for easier reading, as in python, rust etc.
<lotuseater>
oh ELS is TODAY :D
<phoe>
and tomorrow!
<phoe>
we have a full Twitch recording of today
<lotuseater>
yes, two days you said :)
<Bike>
oh, so you just ignore them? i see
ark has quit [Read error: Connection reset by peer]
<Bike>
that does seem a little bit involved as a reader macro since you can't just use READ
ark has joined #lisp
<splittist>
Bike: I snarf up everything until a whitespace or terminating macro char into a string with the _s removed, and READ-FROM-STRING (broadly).
<Bike>
yeah, makes sense.
<jcowan>
that's quite nice
<splittist>
It works, but it seems to be waiting for extra input when READing from *standard-input*. I'll look at some implementation macros to see what might be happening.
<jcowan>
READ doesn't read a terminating newline (it will be ignored by the next READ), which may be your problem in simple REPL testing.
<splittist>
jcowan: you can even #44_123,456,789 . (I think I decided to disallow #32_123 456 789 (: )
<splittist>
jcowan: ah. Good point.
long4mud has quit [Ping timeout: 252 seconds]
<lotuseater>
so one of the complement things that are possible with FORMAT's ~d (not just grouping in parts of three digits)
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
<jcowan>
Before the Unixifcation of Lisp, READ read characters in raw mode (which was all there was) so as soon as you typed the matching ) it took off. That accounts for the references to "rubout handlers", since deleting a character meant unparsing. It also explains why PRINT prints a newline first instead of last.
nature has quit [Ping timeout: 252 seconds]
<jcowan>
the order was read up to last ), evaluate, print CRLF, print value
<splittist>
lotuseater: yeah. (format t "~:,,'_,4d" rupees)
actuallybatman has joined #lisp
theothornhill has joined #lisp
<pjb>
jcowan: well, right, but print with terpri first, was foremost a legacy of line printer and punched cards.
<jcowan>
How is that? When you read a card, you get an implied terminator
<pjb>
you could write a format function to do it (format nil "~20,2/indian-grouping/" 30000000) --> " 3,00,00,000.00"
cantstanya has joined #lisp
<beach>
lukego: If you like to discuss implementation techniques, a lot of discussions happen in #sicl.
<beach>
lukego: And we take questions, too. :)
theothornhill has quit [Ping timeout: 252 seconds]
aeth has quit [Ping timeout: 265 seconds]
theothornhill has joined #lisp
aartaka_d has joined #lisp
srandon111 has joined #lisp
aeth has joined #lisp
remby has joined #lisp
<jcowan>
lotuseater: It matches the pattern of Indian numeral words: a lakh is 100 thousand and a crore is 100 lakh (names vary in different Indian languages, but these are the ones used in "I have a doubt" English. :-)
<lotuseater>
:)
mhd2018 has joined #lisp
orivej has joined #lisp
Nilby has joined #lisp
aartaka has quit [Ping timeout: 260 seconds]
theothornhill has quit [Ping timeout: 252 seconds]
jeosol has joined #lisp
<phoe>
I remember that there was a recent discussion about the commercial version of OpenGenera and how it works at the moment - could someone help me look for it?
<phoe>
and about its current licensing state and the commercial VLM code
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
renzhi has quit [Ping timeout: 260 seconds]
theothornhill has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
remby9 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
remby has quit [Ping timeout: 240 seconds]
amb007 has joined #lisp
jonatack has quit [Ping timeout: 252 seconds]
skami has joined #lisp
jonatack has joined #lisp
xkapastel has joined #lisp
<skami>
Hello everyone. I had some weird bug today that when I did `(somesymbol somethingelse) I would get some garbage at the end on the list on subsequent execution of the function. I managed to find that this was caused by a call to mapcan somewhere else. Would have there been a way to track this kind of bug like setting a watchpoint or something like that on the cddr of the original two element list ? Thanks in advance
<phoe>
skami: I don't think you can set watchpoints on when concrete objects are modified
shifty has quit [Ping timeout: 240 seconds]
<phoe>
I'm not aware of any implementation that does that
shifty has joined #lisp
<skami>
kevingal: Thanks, interesting read
ukari has quit [Remote host closed the connection]
<skami>
phoe: Ha, that's a bummer. That would be a useful feature
ukari has joined #lisp
LispSporks has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kevingal>
According to that article, ADVISE and WATCH are available in LispWorks, but not SBCL.
<phoe>
!
<phoe>
so LW has it!
<skami>
That's cool, I might try to push for a LispWorks licence at work
<sm2n>
I'm not sure if this is what you want, but sly has something called stickers
hiroaki has joined #lisp
<skami>
It's an interesting feature. If sly can add breakpoints like I wonder if it could be possible to simply setup for sly to break and check if a variable was modified every call and return.
ljavorsk has quit [Ping timeout: 240 seconds]
Sheilong has joined #lisp
remby9 has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 265 seconds]
jeosol has quit [Ping timeout: 240 seconds]
kevingal has quit [Read error: Connection reset by peer]
remby has joined #lisp
notzmv has quit [Ping timeout: 252 seconds]
zeroish- has joined #lisp
irc_user has joined #lisp
Sauvin has quit [Ping timeout: 265 seconds]
CrashTestDummy has joined #lisp
CrashTestDummy3 has quit [Ping timeout: 265 seconds]
attila_lendvai_ has joined #lisp
attila_lendvai has quit [Ping timeout: 246 seconds]
andreyorst[m] has joined #lisp
Inline has quit [Ping timeout: 260 seconds]
koolkat332 has joined #lisp
wowzersbrain has joined #lisp
koolkat332 has quit [Ping timeout: 252 seconds]
gaqwas has joined #lisp
gaqwas has quit [Changing host]
gaqwas has joined #lisp
theothornhill has quit [Ping timeout: 260 seconds]
theothornhill has joined #lisp
albusp has joined #lisp
verdammelt has joined #lisp
theothornhill has quit [Ping timeout: 240 seconds]
bilegeek has joined #lisp
wowzersbrain has quit [Ping timeout: 240 seconds]
ilshad` has joined #lisp
zeroish- has quit [Ping timeout: 240 seconds]
theothornhill has joined #lisp
ilshad has quit [Ping timeout: 268 seconds]
anticrisis has joined #lisp
frgo has quit []
caret has joined #lisp
andreyorst` has joined #lisp
ilshad`` has joined #lisp
cosimone has joined #lisp
Inline has joined #lisp
bjorkintosh has joined #lisp
ilshad` has quit [*.net *.split]
ukari has quit [*.net *.split]
amb007 has quit [*.net *.split]
actuallybatman has quit [*.net *.split]
v88m has quit [*.net *.split]
imode has quit [*.net *.split]
yitzi has quit [*.net *.split]
ebrasca has quit [*.net *.split]
scm has quit [*.net *.split]
rodriga has quit [*.net *.split]
gumman has quit [*.net *.split]
zaquest has quit [*.net *.split]
cods has quit [*.net *.split]
kslt1 has quit [*.net *.split]
acolarh has quit [*.net *.split]
add^_ has quit [*.net *.split]
tgbugs has quit [*.net *.split]
phadthai has quit [*.net *.split]
Ziemas has quit [*.net *.split]
d4ryus has quit [*.net *.split]
X-Scale has quit [*.net *.split]
joast has quit [*.net *.split]
nature has quit [Ping timeout: 240 seconds]
v88m has joined #lisp
add^_ has joined #lisp
ukari has joined #lisp
amb007 has joined #lisp
imode has joined #lisp
actuallybatman has joined #lisp
ebrasca has joined #lisp
yitzi has joined #lisp
tgbugs has joined #lisp
joast has joined #lisp
scm has joined #lisp
cods has joined #lisp
gumman has joined #lisp
acolarh has joined #lisp
phadthai has joined #lisp
Ziemas has joined #lisp
d4ryus has joined #lisp
zaquest has joined #lisp
rodriga has joined #lisp
X-Scale has joined #lisp
kslt1 has joined #lisp
andreyorst[m] has quit [Remote host closed the connection]
jeosol has joined #lisp
undvrainbowvita8 has quit [Ping timeout: 240 seconds]
Krystof has quit [Ping timeout: 265 seconds]
X-Scale has quit [Ping timeout: 252 seconds]
Krystof has joined #lisp
caret has quit [Read error: Connection reset by peer]
X-Scale has joined #lisp
madage has quit [Ping timeout: 240 seconds]
<phoe>
nice
<phoe>
I received a bugticket on p-c-s tests because the people reimplementing it in clojure found a bug that was not caught by the test suite
<phoe>
but the test suite is actually ANSI-TEST so I get to add another test to it while fixing the p-c-s ticket!
DHARMAKAYA has joined #lisp
madage has joined #lisp
attila_lendvai_ has quit [Ping timeout: 268 seconds]
paul0 has joined #lisp
mh__ has joined #lisp
narimiran has quit [Quit: leaving]
notzmv has joined #lisp
notzmv is now known as Guest50015
supercoven has quit [Ping timeout: 268 seconds]
pve has quit [Quit: leaving]
frgo has joined #lisp
orivej has quit [Ping timeout: 252 seconds]
verdammelt has quit [Ping timeout: 240 seconds]
contrapunctus has left #lisp ["Disconnected: closed"]
nick3000 has quit [Remote host closed the connection]
mindCrime_ has quit [Ping timeout: 240 seconds]
bilegeek_ has joined #lisp
verdammelt has joined #lisp
bilegeek has quit [Ping timeout: 245 seconds]
Lycurgus has quit [Quit: Exeunt]
kevingal has joined #lisp
dyelar has joined #lisp
<gendl__>
does anyone know what it means when Swank/Slime crashes the lisp instead of giving a debugger?
verdammelt has quit [Ping timeout: 268 seconds]
wsinatra has quit [Quit: WeeChat 3.1]
<Bike>
slime crashes? you know it's not just your lisp crashing?
<gendl__>
when I connect to a container at home, it works fine, proper debugger. When tunneling to a remote server, it just crashes lisp instead of giving a debugger. And it spews some nonsensical error. (I can paste the error later but just in case this is some obvious common thing -- I seem to think I've had it and fixed it before... but once again apparently I didn't formalize the fix...)
<opcode>
i've had sly crash all of emacs when using sly and company-mode together
<gendl__>
well it is Lisp crashing but with some swank/slime errors
<opcode>
i switched back to slime
<gendl__>
I think the lisp is just exiting because it sees end-of-file on the input or something... anyway it's kinda dangerous to slime in to a production server to try to monkey-patch it when any slip of the keyboard will crash the lisp... kinda defeats the purpose.. I have to fix other stuff first though unless this is something common and obivous
<theo[m]>
Is it the cl+ssl issue?
kevingal has quit [Remote host closed the connection]
brandflake11 has quit [Quit: ERC (IRC client for Emacs 27.2)]
aartaka has joined #lisp
whosit has quit [Read error: Connection reset by peer]
aartaka_d has quit [Ping timeout: 246 seconds]
DHARMAKAYA has quit [Quit: Turning off a portion of this simulation.]
cranium_ has quit [Quit: Leaving]
aartaka has quit [Ping timeout: 252 seconds]
<gigamonkey>
(* 2000 2)
<gigamonkey>
Heh. a) wrong buffer b) duh, of course I can multiply that in my head.
luckless has quit [Ping timeout: 240 seconds]
<gendl__>
theo[m]: I don't think it has to do anything with ssl. Slime/swank are not using ssl are they?
Guest50015 is now known as notzmv
theothornhill has quit [Ping timeout: 246 seconds]
<theo[m]>
gendl__: no, but sometimes hunhentoot and drakma breaks when loading, halting on cl+ssl
<theo[m]>
Not sure if you load some libraries that load it transitively
<gendl__>
enough speculation. 👆 there's the error.
drl has joined #lisp
<gendl__>
the first error is from my (load-glime) which (rightly) throws an error because of a NIL pathname.
<gendl__>
but then it disgorges some unholy mess from the bowels of swank and the lisp exits (then restarts in this case because the server is running it in an infinite loop).
<gendl__>
is it a stream thing? Do I need to set some stream parameters after connecting?
gigamonkey has quit [Ping timeout: 265 seconds]
<gendl__>
looks like it's trying to show the backtrace from my legit error but it's mixed with a bunch of swank stream stuff
verdammelt has joined #lisp
undvrainbowvita8 has joined #lisp
luckless has joined #lisp
drl has quit [Ping timeout: 250 seconds]
gigamonkey has joined #lisp
<luis>
gendl__: dispatch-loop in swank.lisp calls the ABORT restart if anything goes wrong with the connection, hopefully that's only aborting the swank thread rather than the whole Lisp?
<gendl__>
I'm pretty sure it's exiting the lisp. but I'll confirm that.
<luis>
gendl__: it could also be that some unhandled error is killing your lisp if you have the debugger disabled
luckless has quit [Remote host closed the connection]
<gendl__>
oooh. maybe I'm not building the debugger into my build
cosimone has quit [Remote host closed the connection]
luckless has joined #lisp
<gendl__>
I'm using (ccl:save-application :prepend-kernel t ... )
<gendl__>
maybe I have to tell it to include the dev environment and debugger when I do that?
<gendl__>
I need to rtfm more...
akoana has joined #lisp
<luis>
gendl__: you can test this hypothesis with something simpler like (error "foo")
<gendl__>
I'm used to Allegro CL where you can include or exclude things on a fairly fine-grained basis.
<phoe>
:error-handler :listener
<phoe>
seems like this
<gendl__>
oh?
<phoe>
grep the page for error-handler
<phoe>
it's a kwarg to save-application
<akoana>
hi, I'm a bit confused by Peter Norvig's GPS example, he uses (defvar *state* ...) and (defvar *ops* ...) then (defun GPS (*state* goals *ops*) ...) as shown on https://github.com/norvig/paip-lisp/blob/master/docs/chapter4.md under 4.3 Stage 3: Implementation. Why does he use earmuffs in the defun lambda-list, is that anything special?
<Bike>
so that they're the same variables?
<gendl__>
yes but it defaults to :listener
<phoe>
oh
<Bike>
when you call gps it will bind those special variables
<gendl__>
anyway I'll try specifying it
<phoe>
hm
<phoe>
I'll crash asleep instead then
ntqz has joined #lisp
<gendl__>
yep, beddy time.
<White_Flame>
akoana: (defun GPS (*state* ...) ..) has the same effect as (let ((*state* ...)) ...) regarding the parameter
nullman` has joined #lisp
<White_Flame>
and (defun foo (params &optional (*var* *var*)) ...) is another pattern I've seen
lotuseater has quit [Quit: ERC (IRC client for Emacs 27.1)]
nullman has quit [Ping timeout: 240 seconds]
drl has joined #lisp
Posterdati has quit [Ping timeout: 246 seconds]
flazh has joined #lisp
klltkr has joined #lisp
<akoana>
thanks, hmm, not sure if I understand that, I'm quite new to Common Lisp... and I've not seen that anywhere else before (reading Practical Common Lisp too)...
<akoana>
at least not in a defun lambda-list...
<saturn2>
you can establish a dynamic binding on a special variable anywhere you can establish a lexical binding, including a function call
<akoana>
ah, ok now I see, thanks!
<akoana>
thank you Bike, White_Flame and saturn2
rumbler31 has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
Posterdati has joined #lisp
<White_Flame>
the earmuffs are of course just a naming convention. It's the defvar/defparameter that declares that the variable is "special", and thus (let ((*var* ...)) ...) is visible from anywhere in the same thread during the lifetime of that scope
<White_Flame>
(defun foo (&optional (*var* *var*)) ..) means that (foo) rebinds the variable to its existing value, and (foo 3) would rebind it to 3 within that scope
<White_Flame>
which is a syntactically short way to have it optionally redefined
<akoana>
yes, the &optional example was the clue for me :)
andreyorst[m] has joined #lisp
andreyorst` has quit [Quit: andreyorst`]
gigamonkey has joined #lisp
<akoana>
White_Flame: nevertheless, your excellent explanation was very insightful for me, thanks
<akoana>
(before I was wondering why *state* and *ops* weren't used at all in the body of gps, lol)
anticrisis_ has joined #lisp
gaqwas has quit [Ping timeout: 268 seconds]
anticrisis has quit [Ping timeout: 240 seconds]
surabax has quit [Quit: Leaving]
random-nick has quit [Ping timeout: 240 seconds]
<akoana>
so (let ((*state* state-value) (*ops* ops-value) (gps goals))) would have the same effect as
irc_user has quit [Quit: Connection closed for inactivity]
shifty has quit [Ping timeout: 268 seconds]
zeroish has joined #lisp
Nilby has quit [Ping timeout: 276 seconds]
k-stz has joined #lisp
k-stz has left #lisp [#lisp]
Spawns_Carpetin- has joined #lisp
orivej has joined #lisp
Inline has quit [Ping timeout: 260 seconds]
renzhi has joined #lisp
monolithic has quit [Ping timeout: 265 seconds]
imode has quit [Ping timeout: 252 seconds]
mindCrime_ has joined #lisp
monolithic has joined #lisp
Spawns_Carpetin- has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
Spawns_Carpetin- has joined #lisp
igemnace has quit [Quit: WeeChat 3.1]
Oladon has joined #lisp
<pjb>
skami: So, you understand now that the problem is that the backquote reader macros reads an expression that may return some literal data, that must be considered immutable, but that you have modified with mapcan. The way to avoid it, is to remember that mapcan mutates the results of the mapped function.
<pjb>
skami: In those cases, you may use copy-list in the mapped function: (mapcan (lambda (x) (copy-list `(…))) …)
<pjb>
skami: or to use concatenate, if the mapped list is short (less than call-arguments-limit -2): (apply (function concatenate) 'list (mapcaR (lambda (x) `(…))))
<pjb>
skami: beware: don't use append, since append does not copy the last list!
<pjb>
skami: in general, beware with the mututating functions (non-consing functions, and other functions that modify the objects passed in parameter).
<pjb>
skami: now, there is not a lot of option to debug it (apart trying to locate where it's modified, by looking at the modified data), because while literal data is theorically immutable, in practice there's no difference between literal objects and normal objects, notably when you work at the REPL.
<pjb>
skami: The compiler could arrange things to put the literal data in a read-only segment, but since most implementation use lisp images, they dont save file formats with read-only data segments. Only ecl does that (compiling to elf files using gcc), but I don't know if it takes advantage of that to arrange for literal data to be read-only.
andreyorst[m] has quit [Quit: WeeChat 3.0.1]
<pjb>
skami: some scheme implementations have immutable pairs, but this is quite inconvenient…
drl has quit [Quit: Leaving]
<pjb>
skami: that said, nothing would prevent you to patch your implementation to add such a feature. We could have a (ext:set-read-only object) extension such that if a mutator is applied later on the object, an error condition is signaled.
<pjb>
skami: it would be an interesting project to do that.
<pjb>
skami: then you could add calls to EXT:SET-READ-ONLY in reader macros, and in the QUOTE operator.
Sheilong has quit []
Josh_2 has joined #lisp
Josh_2 has quit [Remote host closed the connection]
monolithic has quit [Remote host closed the connection]
drl has joined #lisp
Spawns_Carpetin- has quit [Ping timeout: 260 seconds]
zaquest has quit [Remote host closed the connection]