ebrasca has quit [Remote host closed the connection]
<stylewarning>
lxbarbosa: I think understanding strictly typed parametric polymorphism and how lazy evaluation affects API boundaries is important
<lxbarbosa>
stylewarning: hm, cool. I hope there are epub Haskell books, not in the mood of touching lately :D
SGASAU` has quit [Remote host closed the connection]
SGASAU` has joined #lisp
<loli>
lxbarbosa: there are tools lisp could easily steal, ADTS are an example (and thus deriving functions over this structure)
<loli>
probably stealing effect systems would be nice. Though they are quite primitive in Haskell
SGASAU` has quit [Remote host closed the connection]
SGASAU` has joined #lisp
pilne_ has joined #lisp
pilne has quit [Ping timeout: 260 seconds]
<White_Flame>
stylewarning: please try to sell the keyboards to people with a lispm that need one
<White_Flame>
instead of the idiot keyboard hoarders
<loli>
are people selling the space cadet?
<White_Flame>
ye olde original? well, just on the used market
<White_Flame>
if you can find one obv
v1sage has quit [Quit: v1sage]
<lxbarbosa>
loli: I expect lots of fun learning it :)
<loli>
lxbarbosa: you will! I find it's a nice language, though beware you might just taking harder languages like Coq or F*
<loli>
stay away!
lxbarbosa has quit [Remote host closed the connection]
iAmDecim has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
iAmDecim has quit [Ping timeout: 250 seconds]
ebzzry has joined #lisp
bitmapper has quit [Ping timeout: 250 seconds]
EvW has quit [Ping timeout: 272 seconds]
markong has quit [Ping timeout: 256 seconds]
fookara has quit [Remote host closed the connection]
libertyprime has joined #lisp
terpri_ has quit [Remote host closed the connection]
space_otter has joined #lisp
terpri_ has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 252 seconds]
iAmDecim has joined #lisp
lisper29 has left #lisp [#lisp]
v_m_v has joined #lisp
Nikotiini has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
v_m_v has quit [Ping timeout: 260 seconds]
bendersteed has quit [Quit: bye]
Inline has quit [Ping timeout: 272 seconds]
GeissT has quit [Ping timeout: 256 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
GeissT has joined #lisp
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
jeosol has joined #lisp
torbo has joined #lisp
efm has quit [Quit: Konversation terminated!]
akoana has left #lisp ["Leaving"]
<beach>
Good morning everyone!
iAmDecim has joined #lisp
<jeosol>
Good morning beach
iAmDecim has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
sjl has joined #lisp
Bourne has quit [Ping timeout: 264 seconds]
elderK has joined #lisp
<sjl>
When using &key (foo some-form foo-supplied?) in a destructuring-bind, shouldn't foo-supplied be bound to true if :foo is given in the call and false otherwise?
dreamcompiler has quit [Read error: Connection reset by peer]
dreamcompiler has joined #lisp
gigetoo has quit [Ping timeout: 265 seconds]
pilne_ has quit [Quit: Now if you will excuse me, I have a giant ball of oil to throw out my window]
Oladon has joined #lisp
fookara has joined #lisp
C-Keen has joined #lisp
C-Keen is now known as Guest56414
gigetoo has joined #lisp
iAmDecim has joined #lisp
narimiran has joined #lisp
v_m_v has joined #lisp
SGASAU`` has joined #lisp
v_m_v has quit [Ping timeout: 256 seconds]
iAmDecim has quit [Ping timeout: 264 seconds]
SGASAU` has quit [Ping timeout: 256 seconds]
froggey has quit [Ping timeout: 252 seconds]
SGASAU``` has joined #lisp
froggey has joined #lisp
elderK has quit [Quit: WeeChat 1.9]
SGASAU`` has quit [Ping timeout: 240 seconds]
Bike has quit [Quit: Lost terminal]
Codaraxis has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
torbo has quit [Remote host closed the connection]
SGASAU``` has quit [Ping timeout: 260 seconds]
EvW1 has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
renzhi has joined #lisp
stepnem_ has joined #lisp
stepnem has quit [Ping timeout: 264 seconds]
renzhi has quit [Ping timeout: 256 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
iAmDecim has joined #lisp
shka_ has joined #lisp
iAmDecim has quit [Ping timeout: 260 seconds]
mathrick has quit [Remote host closed the connection]
mathrick has joined #lisp
flazh has quit [Ping timeout: 252 seconds]
dddddd has quit [Ping timeout: 250 seconds]
EvW1 has quit [Ping timeout: 252 seconds]
flazh has joined #lisp
gravicappa has joined #lisp
shka_ has quit [Ping timeout: 264 seconds]
heisig has joined #lisp
ArthurStrong has quit [Quit: leaving]
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #lisp
heisig has quit [Quit: Leaving]
Oladon has quit [Quit: Leaving.]
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #lisp
iAmDecim has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
JetJej has quit [Quit: [Quit]]
kamog has joined #lisp
ebzzry has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
twelvemonkeys has quit [Ping timeout: 260 seconds]
twelvemonkeys has joined #lisp
CrazyEddy has quit [Ping timeout: 258 seconds]
random-nick has joined #lisp
jprajzne has quit [Quit: jprajzne]
fookara has quit [Remote host closed the connection]
aap_ is now known as aap
Guest56414 has quit [Changing host]
Guest56414 has joined #lisp
Guest56414 is now known as C-Keen
rumbler31 has quit [Read error: Connection reset by peer]
fookara has joined #lisp
rumbler31 has joined #lisp
|Pirx| has quit [Read error: Connection reset by peer]
|Pirx| has joined #lisp
fookara has quit [Remote host closed the connection]
simplegauss has quit [Ping timeout: 265 seconds]
fookara has joined #lisp
femi has quit [Ping timeout: 265 seconds]
v_m_v has joined #lisp
space_otter has quit [Ping timeout: 265 seconds]
quazimodo has quit [Ping timeout: 265 seconds]
hjudt has quit [Ping timeout: 265 seconds]
theBlackDragon has quit [Ping timeout: 265 seconds]
loke` has joined #lisp
fouric has quit [Ping timeout: 265 seconds]
quazimodo has joined #lisp
theBlackDragon has joined #lisp
loke has quit [Ping timeout: 265 seconds]
twelvemonkeys has quit [Ping timeout: 240 seconds]
gabot has quit [Ping timeout: 265 seconds]
femi has joined #lisp
simplegauss has joined #lisp
twelvemonkeys has joined #lisp
v_m_v has quit [Ping timeout: 265 seconds]
hjudt has joined #lisp
space_otter has joined #lisp
fouric has joined #lisp
v88m has quit [Remote host closed the connection]
gabot has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
dale has quit [Quit: My computer has gone to sleep]
Bourne has joined #lisp
<phoe>
Where in CLHS are FTYPE lambda lists defined?
ebzzry has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
<phoe>
found it, System Class FUNCTION
<beach>
That's not considered a lambda list.
<phoe>
yes, correct
Cymew has joined #lisp
iAmDecim has joined #lisp
jprajzne has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
ebzzry_ has joined #lisp
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
amerlyq has joined #lisp
ebzzry_ has joined #lisp
ebzzry has quit [Remote host closed the connection]
space_otter has quit [Remote host closed the connection]
terpri_ has quit [Remote host closed the connection]
terpri_ has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
ebzzry_ has joined #lisp
v_m_v has joined #lisp
amazoniantoad has joined #lisp
Codaraxis_ has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
Inline has joined #lisp
<amazoniantoad>
Hey guys. I'm trying to take two columns and generate a matrix from their multiplication. Could anyone show me how to do this? Currently I'm trying to do (elt (elt matrix i) j) and using setf to set the value. But instead of getting unique values for every cell I wind up getting the exact same row in the matrix
<no-defun-allowed>
Why are you using an array of arrays? Common Lisp has n-dimensional arrays.
<amazoniantoad>
oh
<amazoniantoad>
So what should I be doing instead?
<no-defun-allowed>
And are you talking about matrix multiplication, element-wise multiplication, or...?
ljavorsk has joined #lisp
<amazoniantoad>
yes, element-wise
<no-defun-allowed>
And you have two 2d arrays you want to multiply the elements of?
<amazoniantoad>
No. Two 1D arrays and I want to create from that a 2D array
Codaraxis has quit [Ping timeout: 258 seconds]
<no-defun-allowed>
How do you get a 2D array from two 1D arrays? Something like O_i,j = M_i × N_j?
ebzzry_ has quit [Read error: Connection reset by peer]
<amazoniantoad>
yes
<no-defun-allowed>
Well, to make a 2 dimensional array, you can use (make-array (list columns rows)), and then (setf (aref <array> column row) value) to set an element of that array.
<no-defun-allowed>
(Using Petalisp, you could write (defun cross-multiply (a b) (petalisp:α #'* (petalisp:reshape a (petalisp:τ (i) (i 0))) (petalisp:reshape b (petalisp:τ (j) (0 j))))). I don't think Common Lisp is very nice for doing n-dimensional array work without some helper functions.)
<phoe>
that's a big step up from simple standard CL functions though
<no-defun-allowed>
True.
<phoe>
I don't think amazoniantoad is a possible client for petalisp if he's still working on getting the basics of 2D arrays done - maybe in a few months, but not yet
<no-defun-allowed>
Writing a step between a JIT-compiling parallel array manipulation DSL and using big loops of (setf aref) is left to the reader.
jeosol has quit [Remote host closed the connection]
ljavorsk has quit [Read error: Connection reset by peer]
ljavorsk_ has joined #lisp
CrazyEddy has joined #lisp
fanta1 has joined #lisp
ebzzry_ has joined #lisp
ggole has joined #lisp
karlosz has quit [Quit: karlosz]
fookara has quit [Read error: Connection reset by peer]
kamog has quit [Remote host closed the connection]
kamog has joined #lisp
<beach>
That's not what I would call "element-wise", but hey.
<no-defun-allowed>
I wouldn't call it element-wise either.
<no-defun-allowed>
amazoniantoad: "element-wise" would probably refer to O_i = M_i + N_i, if I'm not mistaken.
<Shinmera>
indeed it would.
kamog has quit [Remote host closed the connection]
<pjb>
but this involves allocating O(n*m) temporary conses…
<pjb>
Well, you can also use (map 'vector (lambda (x) (map 'vector (lambda (y) (* x y)) v2)) v1) which should be more efficient allocating temp storage, but still O(m*n) temp space.
CrazyEddy has quit [Ping timeout: 260 seconds]
flip214 has quit [Ping timeout: 256 seconds]
flip214 has joined #lisp
Codaraxis has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #lisp
Codaraxis_ has quit [Ping timeout: 250 seconds]
vlatkoB_ has joined #lisp
vlatkoB has quit [Ping timeout: 256 seconds]
Codaraxis has quit [Read error: Connection reset by peer]
CrazyEddy has joined #lisp
mgsk_ has quit [Ping timeout: 256 seconds]
borodust has quit [Ping timeout: 256 seconds]
Bourne has quit [Ping timeout: 256 seconds]
cartwright has quit [Ping timeout: 240 seconds]
mgsk_ has joined #lisp
vlatkoB_ has quit [Quit: No Ping reply in 180 seconds.]
borodust has joined #lisp
adlai has joined #lisp
borodust is now known as Guest64823
vlatkoB has joined #lisp
cartwright has joined #lisp
hiroaki has quit [Ping timeout: 258 seconds]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
rippa has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 256 seconds]
<LdBeth>
(april:april "1 2 3 ∘.× 10 20 30 40")
<flip214>
Can a compiler macro (or normal macro) get the form(s) it's embedded in? SBCL only would work for that use case.
<LdBeth>
I think there's a CLtL2 extension or something
<phoe>
flip214: I don't think so. The only thing available is the environment, and that doesn't contain everything.
<Shinmera>
flip214: that sounds like you're trying something very ugly
<adlai>
flip214: "The value of - is the form that is currently being evaluated by the Lisp read-eval-print loop." (obviously, doesn't work in files)
<flip214>
adlai: thanks, that won't help
v_m_v has quit [Remote host closed the connection]
<flip214>
I've got a function that asks the user a question - and I'd like to determine whether the outer form wants a string, boolean, or number result
<pjb>
flip214: it cannot, and this is for the best. This is the best feature of lisp macros, not to be able to know anything about the outer form. This is what makes them secure!
<pjb>
flip214: however, there is macrolet (and symbol-macrolet), which can be used in the EXPANSION of an outer macro. (and also flet and labels).
v_m_v has joined #lisp
<flip214>
pjb: yeah, and compiler-let, and similar stuff. I'm just wondering whether there's an easier way - #'<= in the outer form requires a number, string= a string, etc.
<pjb>
flip214: this let you design an outer macro, in which you can have access to a macro. The outer macro can arrange to give the information needed by the inner macro, even if comes from forms outside of the inner macro (but inside the outer macro, of course).
xkapastel has joined #lisp
<pjb>
flip214: that said you are not allowed to shadow the fbinding of symbols in the CL package, or defining compiler-macros on them. So you have two ther reason why you won't be able to do that for <= or string=.
<pjb>
flip214: but you can do it for your-own:<= or your-own:string=
<pjb>
flip214: now, I don't think there's any guarantee about the environments for macro-expansion and compiler-macro expansion. I don't think you could conformingly pass information from a macro to a compiler-macro. This would have to be checked in the CLHS.
<pjb>
flip214: but once you have a wrapper macro, you don't really need compiler-macro, and this would allow you to do stuff on forms using symbols in the CL package as operators.
<pjb>
flip214: (just code-walk your inner forms, and do whatever you want).
davsebamse has quit [Read error: Connection reset by peer]
aamukastemato has joined #lisp
davsebamse has joined #lisp
<phoe>
flip214: the outer form should pass the expected input type to the function, that's the cleanest way I can think of
<phoe>
either that, or bind dynavars
<phoe>
but the latter is ugly
<LdBeth>
write a type inference macro
<phoe>
this escalated quickly
<no-defun-allowed>
What part of [Hindley-Milner equations] do you not understand?
<flip214>
phoe: Yeah, that's what I thought, too... I'd just like to avoid having my own code-walker, there are already too many of them ;/
<Inline>
unless an environment is passed explicitly in the macro
<LdBeth>
well, actually F_omega is required
<flip214>
I hoped that I there's an easy way to see what the outer function is - and then the expected type is easy...
ukari has quit [Remote host closed the connection]
<phoe>
flip214: if you want a true, absolute hack, use DISSECT at runtime to analyze the stack, figure out which function you were called from, and adjust the typecheck accordingly
ukari has joined #lisp
<phoe>
I'd shoot anyone who tried to do that in the code that I maintain
<LdBeth>
I donut think expected type would be easy for lisp
<flip214>
phoe: no, not at runtime, via &environment would be good enough ;)
<flip214>
LdBeth: most functions have input/output types already declared, and in the worst case I have to annotate the symbol
<Inline>
introspect-environment heh
<phoe>
flip214: how about the symbol-macro trick then? you set a symbol-macro in the environment with the expected type that you can then macroexpand in the inner macro
<LdBeth>
flip214: what if the outer function is PRINT
<LdBeth>
or CONS
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
<flip214>
LdBeth: the query function will only occur within AND, OR, <=, STRING=, and similar stuff. It's not general-purpose.
prince1 has quit [Ping timeout: 264 seconds]
<flip214>
thanks, everybody!
epony has quit [Quit: reconfig]
epony has joined #lisp
cosimone has joined #lisp
cosimone has quit [Client Quit]
v_m_v has quit [Remote host closed the connection]
libertyprime has quit [Read error: Connection reset by peer]
markong has joined #lisp
libertyprime has joined #lisp
aamukastemato has quit [Ping timeout: 264 seconds]
Bike has joined #lisp
<phoe>
`AND` and `OR` will already be macroexpanded by the time your form is macroexpanded
<flip214>
phoe: these are not the CL:AND and CL:OR that you're looking for
<flip214>
(that even rhymes! now let's bring it into 19 syllables... ;)
<Bike>
doing something different based on the return type sounds like a job for static typing. which is to say, might be in the wrong language here
gko has joined #lisp
<flip214>
Bike: why? a GF chooses a method based on the input type as well, so I'd see that as some kind of symmetry
lalilulelo has joined #lisp
<Bike>
it chooses a method based on the input _object_
<Bike>
the class thereof, but nonetheless it has an actual object to work with
<Bike>
(usually the class, i mean, there are also eql specializers)
<Bike>
since you don't have an output object, doesn't quite work the same way.
<Bike>
if it actually chose a method based on the type, you could indeed have it do different things based on the output type. but that information does not necessarily exist in lisp.
terpri_ has quit [Remote host closed the connection]
markoong has joined #lisp
terpri_ has joined #lisp
drl has joined #lisp
<phoe>
flip214: ooooh
iAmDecim has quit [Quit: WeeChat 1.9]
iAmDecim has joined #lisp
markong has quit [Ping timeout: 265 seconds]
<flip214>
Bike: (SATISFIES NUMBERP)
<Bike>
please use words if you want to try to explain something to me
<phoe>
flip214: SATISFIES is not a class
markong has joined #lisp
bitmapper has joined #lisp
<Bike>
despite the efforts of the best alchemists i can hire, i haven't yet restored my pineal gland to its ancestral power and so cannot read minds
<beach>
Sad. :(
<Bike>
anyway, things like apply and eval can mess up the concept pretty hard. even just calling something like that at the repl could be a type error for ambiguity
markoong has quit [Ping timeout: 250 seconds]
<Bike>
if you're only using this in specific contexts, you could have those contexts pass along an additional parameter expressing what kind of result is expected, sort of like COERCE
<phoe>
I just had a minor moment of enlightenment
<phoe>
Aren't signals just dynamically-scoped hooks?
<beach>
Signals?
<Bike>
well, handlers, sure.
<phoe>
Or rather - handlers
<phoe>
signals are a means of invoking these hooks.
dddddd has joined #lisp
prince1 has joined #lisp
prince1 has quit [Ping timeout: 258 seconds]
markoong has joined #lisp
cosimone has joined #lisp
mn3m has quit [Read error: Connection reset by peer]
markong has quit [Ping timeout: 256 seconds]
markoong has quit [Ping timeout: 250 seconds]
mn3m has joined #lisp
markong has joined #lisp
libertyprime has quit [Quit: Lost terminal]
vsync has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
sunwukong has joined #lisp
nicktick has quit [Ping timeout: 256 seconds]
v_m_v has joined #lisp
jmercouris has joined #lisp
jmercouris has quit [Remote host closed the connection]
v_m_v has quit [Remote host closed the connection]
<eeeeeta>
gah Closure XML is driving me insane
<eeeeeta>
usocket sockets don't have any kind of line buffering on them, do they?
ullbeking has left #lisp [#lisp]
tim` has joined #lisp
tim` has left #lisp [#lisp]
<phoe>
eeeeeta: I remember that I had to FINISH-OUTPUT them
<phoe>
so AFAIK they are buffered
<eeeeeta>
phoe, how in the nine hells do I turn the buffering off
jmercouris has joined #lisp
<eeeeeta>
I'm this close to giving up and just using SB-BSD-SOCKETS :p
<eeeeeta>
this is read buffering though
sulami has joined #lisp
Bourne has joined #lisp
v_m_v has joined #lisp
sulami has quit [Remote host closed the connection]
<jmercouris>
how to collect only on some condition?
<jmercouris>
in a loop
<beach>
when <condition> collect <stuff>
<jmercouris>
(loop for i from 1 to 10 when nil collect nil)
<jmercouris>
wow I didn't think that would actually work
<jmercouris>
next time I'll try in the REPL before asking
<jmercouris>
thank you anyways :-)
<beach>
Why did you not think it would work?
<jmercouris>
I dont know, Loop is still very hard for me to remember everything
<beach>
It is not about remembering. It is about reading the Common Lisp HyperSpec.
<jmercouris>
my mind was stuck on collecting nil for some reason
<jmercouris>
and I was going to strip out nil at the end via some remove-if
<phoe>
a slightly different construct
<jmercouris>
yeah, rather than using a loop keyword
<phoe>
since then the collecting is unconditional, but the collected value is sometimes NIL
<jmercouris>
exactly what I was doing
<jmercouris>
yes
amerigo has joined #lisp
<beach>
You can also do things like if <condition> collect <thing> else append <things>
v_m_v has quit [Ping timeout: 260 seconds]
<jmercouris>
in this case what are you appending to?
<jmercouris>
the end of the list you would be collecting?
<jmercouris>
rather than prepending?
<d4ryus>
jmercouris: there is video from baggers about loop on youtube :) (search for 'Some Common Lisp Loop Macro Examples')
<beach>
Yes, like COLLECT, APPEND adds to the end of the default list.
<phoe>
(loop for i in '((1) (2) (3) (4) (5) (6)) if (evenp (car i)) collect i else append i)
<phoe>
;=> (1 (2) 3 (4) 5 (6))
<jmercouris>
here's something that I've wondered about for some months
<jmercouris>
when we have a list right, and we join two lists together
<phoe>
you can COLLECT INTO if you want named/multiple collectibles
<beach>
d4ryus: It seems that video has been recommended in the past.
<jmercouris>
sometimes the elements are merged, sometimes a list just gets added tot he list
<phoe>
jmercouris: "merged", what do you mean
<jmercouris>
sometimes they can handle a nil first value, sometimes not
<phoe>
we'd need code examples to answer your question
<jmercouris>
let me look in my notes
<phoe>
since "sometimes" is a poor thing to answer, even if it's good tale material
<beach>
I think what jmercouris is referring to is the traditional idea that Common Lisp lists behave like abstract data types, which they don't.
<jmercouris>
that's more or less what I am getting at yes
<jmercouris>
why are the implementation details revealed
<jmercouris>
like I know what is going on underneath, I've read through all of gentle introduction
<jmercouris>
I'm still looking for an example
<White_Flame>
programming was more low level at that time
<beach>
jmercouris: At some point, you need concrete data types to implement abstract ones. Common Lisp lists give the tools you need to do abstract stuff.
<beach>
jmercouris: And these tools are dirt cheap in terms of performance.
<Bike>
"linked lists have a head and a tail" is fairly anodyne as implementation details go
<jmercouris>
like here's an example
<jmercouris>
(append 'a '(b c d)) -> ERROR
<White_Flame>
and since hardware was constrained, you needed to play games with exact storage mechanisms so as not to blow up ram
<jmercouris>
(append '(b c d) 'a) -> (B C D . A)
<jmercouris>
I get what is going on, but it could just as easily have been written in a smarter way to silently handle the error
<Bike>
i know some languages do this but it just frustrates me
<jmercouris>
I'm not saying I disagree by the way
<phoe>
except then the standard says that you get what you want, which is undefined behaviour
<Bike>
because the system is set up so i can't fix problems because they're fucking invisible
<beach>
jmercouris: This is stuff you should know since (as I recall) you have been programming professionally for some time. It is not specific to Common Lisp.
<jmercouris>
Bike: like in Python :-D?
<Bike>
yes, like in python
<phoe>
or in js
<jmercouris>
Yeah, since 2013 professionally
<jmercouris>
still, using a language as a user, doesn't mean you understand the design decisions
<Bike>
lisp does do some implicit coercion stuff and i'm sometimes negative about that, but it's not as bad as in python or whatever, far as i can tell
<phoe>
I can't agree that (append 'a '(b c d)) ;=> :undefined is a good idea
<beach>
jmercouris: You should definitely avoid languages that silently hide problems in application code.
<phoe>
especially since all user code expects that APPEND always returns a list
<White_Flame>
I think "functions should behave consistently and not randomly behave differently while trying to guess at what the user intends" is a reasonable design decision
<phoe>
so suddenly all code that depends on that must stop depending on that, or, hell, it can return :undefined to
<phoe>
too*
<beach>
phoe: Not true: (append '() 3)
<phoe>
beach: wait a second
<phoe>
oh right
<phoe>
...what surprises me that this is defined behaviour!
<phoe>
"result---an object. This will be a list unless the last list was not a list and all preceding lists were null."
<jmercouris>
Well, there are a lot of people who seem to disagree with you guys, at the very least on accident :-D
<phoe>
well, they can disagree all right
<jmercouris>
Python imports come to mind
<beach>
jmercouris: There is lots of incompetence in software development.
<White_Flame>
that's because they never hit the problems of dealing with attempts at trying to guess user intent
<White_Flame>
python does not behave inconsistently
<jmercouris>
lmao
<jmercouris>
that's a good one
<phoe>
I prefer my code to fail fast, and type errors in dynamic programming are exactly where programs should fail fast
<White_Flame>
and has plenty of errors akin to append's
prince1 has joined #lisp
<phoe>
since type errors are always the programmer's or the user's fault
<beach>
jmercouris: phoe puts it well. Incorrect code should fail sooner rather than later.
<White_Flame>
I mean, by your rationale, "print foo" should work in python3, because it should guess tha tyou're using python 2 style
<jmercouris>
oh man, let's not get into that debacle
<phoe>
agreed, let's not go there
<beach>
jmercouris: As an example of making the language help you, it used to be the case that (setq <var> <form>) at the REPL would silently create variable <var> if it did not already exist. That is a terrible idea, because a spelling mistake in a variable will then go unnoticed.
<jmercouris>
It was also very convenient
cartwright has quit [Ping timeout: 240 seconds]
<jmercouris>
but, true, very error prone
<flip214>
I got around my type-derivation by building the reverse path for all forms in a global during compilation, so that a compiler-macro can find its current form and look up what's "above" it
<beach>
jmercouris: I suggest you read the writings of Bertrand Meyer.
<phoe>
flip214: care to share?
catalinbostan has joined #lisp
<jmercouris>
beach: which?
<beach>
jmercouris: He formalized something known as "programming by contract" which is basically the idea of catching errors as soon as possible. Before him, there was a tendency to hide errors.
lucasb has joined #lisp
prince1 has quit [Ping timeout: 256 seconds]
<beach>
jmercouris: Start with the Wikipedia article on "Design by contract"
<Bike>
flip214: if this is a required part of the semantics you might want to make your function a macro instead
<beach>
jmercouris: If you want to be an excellent professional developer, these are things you should definitely know about.
<jmercouris>
yeah, definitely
<flip214>
phoe: the reversal is more or less trivial... and the compiler macro has a (&whole form) which is used in a GETHASH then
<flip214>
no magic at all
<beach>
I know it can be hard to motivate oneself to study these things, especially when one is "lost in a sea of mediocrity" as Dream Theater puts it.
<jmercouris>
at least I don't have to study about Java Beans anymore
<jmercouris>
what I like about this channel is that there are some smart people, and it can be motivating to learn from them
Steinberg2010 has joined #lisp
<jmercouris>
that's actually why I started with CL, I wanted to learn more and more thoroughly understand programming
<beach>
I totally agree. That's why I hang out here too. There are some very smart and some very knowledgeable people here.
<Bike>
i never really thought about the "design by contract" metaphor but it's pretty good. when you're explaining something to a friend taking shortcuts and being metaphorical and stuff makes sense since they know you and can guess what you mean and so on. with a contract it has to be interpreted by disinterested lawyers and judges, and a computer cares even less than those people
efm has joined #lisp
<White_Flame>
that's why I refer to it as "attempting to guess the user's intent"
<White_Flame>
which obviously it does not have the data to do correctly
Steinberg2010 has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
<White_Flame>
(and obviously doesn't have the intelligence or human empathy to perform it in the first place, even if it did have more data)
<White_Flame>
the intent should be solely in the invocation of the function
jmercouris has quit [Ping timeout: 256 seconds]
<beach>
Bike: Yes, reading his stuff at the time was an eyeopener for me. Before that, a program that crashed was considered the worst thing that could happen. After his writing, we understood that it was better for a program to crash (soon) rather than silently giving the wrong answer.
<phoe>
the collective wisdom of the people who talk here is massive and wonderful - I keep on leaving this IRC session more and more knowledgeable and wise even after years of sitting here
<phoe>
;; and silently hope that I contribute positively to it while I'm learning more Lisp, too
<beach>
Unix code, for instance, silently gave (gives?) the wrong answers. One of the rules that RMS established for the GNU project was to avoid that.
Unigurd`` has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
lavaflow_ has joined #lisp
lavaflow_ has quit [Client Quit]
lavaflow has joined #lisp
fookara has joined #lisp
<sjl_>
re: setq autocreating variables and making typos unnoticed, this why I find defmethod not requiring a defgeneric to be annoying
<beach>
I totally agree.
<beach>
I have spent many hours debugging spelling mistakes in DEFMETHOD.
<sjl_>
Or forgetting a package prefix on the method name. That one is extra fun.
<beach>
Yes, that one too.
<beach>
Interestingly, in the book "Object-Oriented Programming, The CLOS Perspective", one of the authors states that DEFMETHOD was meant to be the primary interface. I think that phrase shows the age of the book.
<dlowe>
why is that worse than misspelling a function name?
<beach>
If you misspell a function name in DEFUN, and try to call it with the intended name, you get an undefined function error.
<beach>
Same if you misspell it in the function-call form.
<splittist>
dlowe: also, defmethods are supposed to interact based on their name.
<splittist>
shared name, I mean
<beach>
With a generic function, you often get the wrong answer, like when you intended to override an existing method specializing to a subclass.
<beach>
dlowe: (bar-frobnicate ...) will result in an error.
<splittist>
dlowe: if you call BAR-FROBNICATE you get an undefined. If you call FROBNICATE with a BAR, anything could happen, depending on your object hierarchy.
<dlowe>
ah, I see what you mean
<phoe>
dlowe: the compiler will warn you about undefined functions
<phoe>
it won't warn you about undefined GFs
<beach>
But I think it should.
<phoe>
I wish SBCL toggled these warnings back on, or made it toggleable
<beach>
And apparently, SBCL used to warn.
<splittist>
beach: you should get on to that
<phoe>
beach: yes, it used to warn about implicitly creating generic functions
<beach>
splittist: What do you suggest I do?
<splittist>
how about a whole new compiler? How hard could it be?
<beach>
Piece of cake. I am on it...
<splittist>
And a program editor, of course.
<splittist>
With an OS to fit them together. Next week is fine.
<beach>
Oh, man, I have articles to update. Can it wait another week?
<splittist>
I'm feeling generous - take 10 days.
<beach>
Whew! Thanks!
<Shinmera>
splittist: psh, without a web browser this'll never take off
jmercouris has joined #lisp
hiroaki has joined #lisp
bitmapper has quit [Ping timeout: 265 seconds]
lxbarbosa has joined #lisp
theBlack1ragon has joined #lisp
orivej has joined #lisp
theBlackDragon has quit [Ping timeout: 264 seconds]
iAmDecim has joined #lisp
Steinberg2010 has joined #lisp
jprajzne has quit [Quit: Leaving.]
shangul has joined #lisp
fookara has quit [Remote host closed the connection]
niklascarlsson has joined #lisp
niklascarlsson has quit [Remote host closed the connection]
achilles has joined #lisp
achilles has quit [Client Quit]
fookara has joined #lisp
Unigurd`` has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
ebzzry_ has quit [Read error: Connection reset by peer]
fookara has quit [Remote host closed the connection]
Unigurd has joined #lisp
fookara has joined #lisp
ebzzry_ has joined #lisp
Steinberg2010 has quit [Ping timeout: 256 seconds]
drl has quit [Quit: Ex-Chat]
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
SGASAU has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
sulami has joined #lisp
gko has quit [Ping timeout: 265 seconds]
sunwukong has quit [Quit: Leaving]
jmercouris has quit [Ping timeout: 265 seconds]
aamukastemato has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
dale_ has joined #lisp
shangul has quit [Ping timeout: 265 seconds]
v_m_v has joined #lisp
iAmDecim has joined #lisp
dale_ is now known as dale
fookara has quit [Remote host closed the connection]
monokrom has joined #lisp
fookara has joined #lisp
frgo has joined #lisp
ebzzry has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
ljavorsk_ has quit [Remote host closed the connection]
ljavorsk_ has joined #lisp
fookara has quit [Remote host closed the connection]
achillesp has joined #lisp
frgo has quit []
achillesp has quit [Remote host closed the connection]
iAmDecim has quit [Ping timeout: 260 seconds]
vivit has joined #lisp
jonatack has quit [Ping timeout: 252 seconds]
prince1 has joined #lisp
jonatack has joined #lisp
fookara has joined #lisp
shangul has joined #lisp
bitmapper has joined #lisp
ebzzry has quit [Remote host closed the connection]
prince1 has quit [Ping timeout: 256 seconds]
lxbarbos` has joined #lisp
lxbarbosa has quit [Ping timeout: 246 seconds]
ebzzry has joined #lisp
fookara has quit [Remote host closed the connection]
<vivit>
Is there a way to express the initform of a slot in terms of other slots on the object?
<adlai>
vivit, no, use an :after method to initialize-instance or shared-initialize
ebzzry has quit [Remote host closed the connection]
mrcom has quit [Ping timeout: 265 seconds]
<vivit>
Why do you need to specify the accesible slots when you call that function? Doesn't the class definition itself already have those?
<vivit>
Or does this operate on a lower level of abstraction than the class definitions
<vivit>
s/have/specify/
<Xach>
vivit: it's optional
<Xach>
vivit: if you specify the args, they are available as arguments, you can also work from the values in the instance already (in an :after)
<beach>
vivit: There is no such thing as an "accessible slot". To refer to a slot, you need to have an existing object. The object does not exist when the initform is evaluated.
mrcom has joined #lisp
<jcowan>
What are the use cases for returning zero values? I mean, it's an obvious generalization of more ordinary multiple values, but when would it make sense?
<_death>
you're not suppose to call this function yourself
<Xach>
jcowan: some prefer it to returning nil to indicate "this function has no meaningful return value"
<Xach>
or some other value
<Xach>
"prefer it to nil or some other value" that is.
* jcowan
nods.
KDr23 has quit [Remote host closed the connection]
<jcowan>
So the main application is in a context when you don't care what values are returned, then.
<Xach>
jcowan: that's how i've seen it used.
<jcowan>
Makes sense
<Bike>
technically it could also be useful in multiple-value-call, but i've never actually seen that
<jcowan>
I'm arguing against the position that in Lisp, a proper monad implementation should be extended from Haskell's one-arg-one-value functions to n-args-m-values. It makes little sense to pass zero values to the next element in a bind chain.
ggole has quit [Quit: Leaving]
FreeBirdLjj has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
pyx has joined #lisp
KDr23 has joined #lisp
pyx has quit [Client Quit]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<pjb>
jcowan: one place you definitely want to return zero values, is in "commands". Ie. functions designed to be called on the REPL, as command, (they may ouput some text), but for which you don't want any result to be displayed to keep the REPL clean.
aamukastemato has quit [Ping timeout: 264 seconds]
<pjb>
jcowan: other places, is when you don't want to leak an internal data. Since all expressions return some value, there's always a value returned by default from a function. Sometimes, you want to make sure that default value is not returned, so you add a (values) to return nothing.
<pjb>
jcowan: note that for commands, if you use a function that returns a big data structure, it may take a lot of time and screen space to print it. This is often when you will take the pain to add the (values) call.
<Bike>
really? i haven't done much haskell programming, but i thought with the semicolon syntax you could write values that weren't bound to anything
<jcowan>
And yet definers seem to mostly return nil, and they are the very essence of nothing-useful-to-return
<jcowan>
Bike: If you mean do-syntax, you can, but that all gets unpacked into calls on map and map-append
<Xach>
defun returning its name has at least one nice use.
<Bike>
well, sure, so analogously youo'd have chains of multiple value call i would think
iAmDecim has joined #lisp
<jcowan>
yes
ukari has quit [Remote host closed the connection]
<jcowan>
I am just not convinced that generalizing monads to multiple args/values (multiple values are the dual of multiple args, passing more than one value to the continuation) is really worth the headache
ukari has joined #lisp
<jcowan>
It is shaky to call anything returning multiple values a function (in the math sense)
karlosz has joined #lisp
<jcowan>
s/shaky/sketchy
<pjb>
jcowan: in CL most definiers return the name that has been defined.
<jcowan>
sorry, brain fart; I was thinking about returning the name
<jcowan>
In Scheme, definitions are not expressions, just syntactic sugar that can only be used at top level or at the start of a let (vel sim.) block.
Guest64823 has left #lisp [#lisp]
borodust has joined #lisp
jonatack_ has joined #lisp
jonatack_ has quit [Client Quit]
jonatack_ has joined #lisp
sulami has quit [Remote host closed the connection]
iAmDecim has quit [Ping timeout: 265 seconds]
jonatack has quit [Ping timeout: 265 seconds]
ljavorsk_ has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
<Bike>
well multiple values are really just a kind of implicit tuple type. the sketchy part is more the implicit coercion of one of those tuples to the primary value in almost all contexts
smazga has joined #lisp
v_m_v has quit [Remote host closed the connection]
Steinberg2010 has joined #lisp
<alandipert>
along those lines, coercion of no values to nil sketches me out a bit
peterhil` has quit [Read error: Connection reset by peer]
nicktick has joined #lisp
fookara has joined #lisp
<vivit>
beach: the hyperspec uses the word "accessible"
peterhil has joined #lisp
Steinberg2010 has quit [Quit: WeeChat 2.7.1]
nicktick has quit [Client Quit]
<Bike>
vivit: update-instance-for-different-class calls shared-initialize with a slots list of only the new slots, so that slots already in the object are not reinitialized.
<Bike>
vivit: and reinitialize-instance calls it with an empty slot list so that no slots are initialized from initforms
lxbarbos` has quit [Ping timeout: 256 seconds]
amerlyq has quit [Quit: amerlyq]
Kundry_Wag has joined #lisp
nicktick has joined #lisp
madage has quit [Remote host closed the connection]
madage has joined #lisp
<jcowan>
The point is that, coercion or not (Scheme doesn't have it), it's possible to implement MVs without reification
v_m_v has joined #lisp
nicktick has quit [Client Quit]
nicktick has joined #lisp
nicktick has quit [Client Quit]
CrazyEddy has quit [Ping timeout: 240 seconds]
Codaraxis has joined #lisp
ArthurStrong has joined #lisp
kopiyka has quit [Remote host closed the connection]
kopiyka has joined #lisp
CrazyEddy has joined #lisp
even4void has joined #lisp
v_m_v has quit [Remote host closed the connection]
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
zerous has joined #lisp
zerous has quit [Changing host]
xlei has joined #lisp
rumbler31 has quit [Ping timeout: 256 seconds]
Cymew has quit [Ping timeout: 256 seconds]
rumbler31 has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
pluplog has quit [Read error: Connection reset by peer]
pilne has joined #lisp
Inline has quit [Remote host closed the connection]
Inline has joined #lisp
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
ljavorsk_ has joined #lisp
ljavorsk_ has quit [Remote host closed the connection]
efm has quit [Ping timeout: 256 seconds]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
madand has quit [Read error: Connection reset by peer]
trn has quit [Quit: quit]
madand has joined #lisp
v0|d has quit [Ping timeout: 264 seconds]
elderK has joined #lisp
madage has quit [Ping timeout: 240 seconds]
cosimone has joined #lisp
trn has joined #lisp
<aeth>
One thing that is not really clear in the conversation (idk if you know it) but in CL, most MV-related things implicitly insert a NIL if there is no argument in the nth position and the nth position is requested. alandipert touched ont his with "coercion of no values to nil".
<aeth>
MV-related things will also tend to drop the extra values, which is less problematic.
<aeth>
I think only multiple-value-call and multiple-value-list don't have this implicit NILness to it.
<aeth>
Of course, (values) is particularly noticable because e.g. (funcall (lambda (x) x) (values)) => NIL whereas (multiple-value-call (lambda (x) x) (values)) is an error.
<Bike>
multiple value call is the only special operator, yes
<aeth>
((lambda (x) x) (values)) is also NIL, the funcall isn't necessary
<phoe>
((lambda (x) x) (values)) coerces (values) into a NIL and then calls the lambda on it
<phoe>
that's per normal rules of evaluation
<phoe>
M-V-C is a special form and therefore isn't affected by that
madage has joined #lisp
catalinbostan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbngr has joined #lisp
fookara has quit [Remote host closed the connection]
fookara has joined #lisp
dreamcompiler has quit [Ping timeout: 260 seconds]
<Bike>
you can imagine having semantics where every call works like multiple-value-call. then you could have (defun primary-value (&optional value &rest rest) (declare (ignore rest)) value)
rumbler31 has quit [Remote host closed the connection]
catalinbostan has joined #lisp
rumbler31 has joined #lisp
dreamcompiler has joined #lisp
narimiran has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
stepnem_ has quit [Read error: Connection reset by peer]
iAmDecim has joined #lisp
<phoe>
using gethash would be ugly
stepnem has joined #lisp
t58 has joined #lisp
pilne has quit [Ping timeout: 250 seconds]
pilne has joined #lisp
<phoe>
why doesn't the Lisp condition system allow signaling arbitrary Lisp objects? what was the rationale for that?
<phoe>
is it that conditions are guaranteed to know how to report themselves?
<Bike>
means you have a type to handle more specific than T
<Bike>
and you can put arbitrary objects in condition slots, so it's no big
<jcowan>
It doesn't?
<phoe>
I'm aware it's no big; I was just curious
<phoe>
the "type to handle more specific than T" is a good reason
<Bike>
jcowan: SIGNAL is defined as having a designator for a condition as an argument, etc
<phoe>
jcowan: you can't signal a 2
<jcowan>
Ah, got it. I was misled by the term "datum" in the CLHS section for signal
prince1 has joined #lisp
<jcowan>
In Scheme exceptions and conditions are independent: you can raise any object, and you can use a condition for any purpose.
<dlowe>
I have wondered why it's not that way in CL
<Bike>
i don't know about scheme, but the lisp condition system can basically be defind in terms of the rest of the language, and usually is actually written that way. so why not make it specific to the task, i guess
prince1 has quit [Ping timeout: 240 seconds]
<jcowan>
Are condition classes usually implemented as standard classes, or by separate machinery?
<dlowe>
usually as standard classes but it's not portable to rely upon it
<dlowe>
in CLtL2 they are always standard-classes but not in ANSI I think
<Bike>
sbcl has a separate condition-class metaclass, i think
<Bike>
yeah. and condition-class shares common superclasses with standard-class but is otherwise independent