erikc has joined #lisp
Chream_ has quit [Ping timeout: 260 seconds]
Chream_ has joined #lisp
<z3t0_> What is the difference between nth-value and second, third etc?
<Xach> z3t0_: nth-value relates to getting one of the multiple-values returned from a function via values
<z3t0_> From what i can tell one of them is for cons but what is nth-value used for then?
<z3t0_> ahh okay I see
<Xach> z3t0_: common lisp can return multiple values from a function, like with decode-universal-time
<z3t0_> Thanks
<Xach> no problem
<jasom> what does the prefix "dx-" mean in sbcl's internals (e.g. dx-flet)
<aeth> z3t0_: you might be looking for nth
randomstrangerb has joined #lisp
<z3t0_> aeth: yes that was it!
<Xach> jasom: dynamic-extent was my impression.
<pjb> (defun nth-value (n form) `(nth ,n (multiple-value-list ,form)))
<pjb> only implementations will implement nth-value without consing the list!
Baggers has quit [Remote host closed the connection]
<jasom> ugh, so dx-flet is a dynamic-extent flet? That's confusing
<jasom> wouldit work like this then? (defun foo () (bar)) (dx-flet ((bar () 1)) (foo)) => 1
<z3t0_> how would i iterate over a cons
fikka has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Remote host closed the connection]
<z3t0_> actually, that's a silly question, never mind :)
<Xach> z3t0_: you normally wouldn't. but it is normal to iterate over a chain of conses (a list) with dolist or loop.
nullman has quit [Ping timeout: 240 seconds]
smasta has quit [Ping timeout: 260 seconds]
<jasom> minion: tell z3t0_ about book
<minion> book: No definition was found in the first 5 lines of http://www.cliki.net/book
<z3t0_> I have a cons of elements that I need to go over in order to process each one, initially i thought of using loop for x in data but that doesn't seem to work
<jasom> minion: tell z3t0_ about pcl
<minion> z3t0_: please see pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<jasom> z3t0_: just in case you haven't found it
fikka has joined #lisp
<z3t0_> thanks
nullman has joined #lisp
<Xach> z3t0_: a cons has only two things in it, the car and the cdr.
<jasom> z3t0_: a cons is just a pair; however they are often used to make a linked list (are you familiar with the linked-list data structure from other languages?)
<z3t0_> Yes I am familiar with linked lists, not too sure about how to deal with them in cl htough
<z3t0_> though*
<pjb> The interesting thing is that in theory, everything can be built from pairs.
<Xach> they are made of conses in cl
<pjb> In practice, it's more efficient if the implementation provides primitive implementations of some other types, but it wouldn't be necessary.
<jasom> z3t0_: when a CONS is used as a list (car FOO) gets you the data element and (cdr FOO) gets you the next cons in the chain
<jasom> z3t0_: and similarly (loop for item in FOO ...) will iterate over the items in FOO, assuming FOO is a list
<jasom> e.g. (loop for item in '(1 2 3 4 5) do (print item))
<z3t0_> mapcar seems to achieve what I want
<jasom> hmm, any ideas on how I could get an unhandled memory fault when not using FFI and restricting safety to 3?
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pixel_Outlaw has joined #lisp
earl-ducaine has quit [Remote host closed the connection]
<paule32> hello
<paule32> where is the error?
earl-ducaine has joined #lisp
z3t0_ has quit [Remote host closed the connection]
z3t0 has joined #lisp
nowhere_man has joined #lisp
<Xach> paule32: the error is not adding what you tried, what you expected, and what you got instead of what you expected.
<paule32> hello Xach
nowhereman_ has joined #lisp
wigust has quit [Ping timeout: 240 seconds]
<paule32> Xach: i would like to test a "half" adder, and "full" adder
<paule32> the input: (2 3)
<paule32> A = 2
<paule32> B = 3
<paule32> Cin = 0 ;; initial = 0
z3t0 has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
<paule32> so first: A + B = 5
pagnol has joined #lisp
<Xach> I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
<jasom> paule32: half-adder has no effects whatsoever
<Xach> paule32: i enjoy helping but the code you offer seems very far from the mark
fikka has quit [Ping timeout: 268 seconds]
<jasom> paule32: it could be replaced by just a function that always returns 'ok
<Xach> paule32: my understanding of a half adder is that it works on bits, as well, and not something like 2 and 3...
<paule32> first, i have wire / cable's
<paule32> as structure
<paule32> (for later => calculations)
<paule32> then, i have circuits or, and, inv
<paule32> A connect(ion) go into D => or-gate
<paule32> B connect(ion) go into and-gate
<paule32> so and-gate has
<paule32> wire a b c
<paule32> that is B
fikka has joined #lisp
<paule32> A is
<paule32> or-gate a b D
<jasom> paule32: can you make a simple buffer out of two inverters with this, and show us it working? Because right now this code literally does nothing other than return 'ok
<paule32> yes, that is the problem
<paule32> no condition
wigust has joined #lisp
<jasom> presumably an and gate would have two wires on its input, and then assert some signal on its output; right now there are no side effects at all.
attila_lendvai has quit [Quit: Leaving.]
<paule32> and-gate a b c => a = 2 b = 3 c = 5
<paule32> ?
<paule32> figure 3.25
<jasom> paule32: note that there is a function-call there, you've just put some symbols next to each other
<jasom> e.g. if you type in: "1 2 3 4" you haven't made a function call, you've just evaluated 4 expressions that do nothing
<paule32> oh
<jasom> "(or-gate a b d)" is not the same as "or-gate a b d"
z3t0 has joined #lisp
<paule32> compare with pasted code
<paule32> common lisp
<jasom> right, but this part scheme and common lisp are the same; no parens means no function call
<jasom> your wires are also missing actions; without actions you can't define the gate functions yet.
<jasom> see add-action! in SICP
<jasom> the inverter and and gates are provided in the book, but the or-gate is an exercise
raydeejay has quit [Ping timeout: 256 seconds]
<paule32> that means, i have to add condition by my self?
<jasom> paule32: yes, CL doesn't come with a built-in logic simulator
<paule32> haha
Cymew has joined #lisp
<paule32> 1: and-gate = A & B => into and-gate
<paule32> if a & b the same => C
zooey has quit [Ping timeout: 255 seconds]
<paule32> else
<paule32> a & b => Einv
<jasom> Thats an xnor actually
<jasom> and is if A & B are logical high, C goes to logical high, otherwise C goes to logical low
zooey has joined #lisp
<jasom> look at (define (and-gate a1 a2 output) ...) in SICP
<jasom> anyway I have dinner now, good luck paule32
<paule32> thx
Cymew has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #lisp
wmannis has quit [Quit: wmannis]
damke has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
damke_ has quit [Ping timeout: 264 seconds]
chrisb has left #lisp [#lisp]
nowhereman_ has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wigust has quit [Ping timeout: 240 seconds]
dented42 has joined #lisp
shifty has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
zazzerino has joined #lisp
openthesky has joined #lisp
nowhereman_ has joined #lisp
nowhere_man has quit [Read error: Connection reset by peer]
EvW has quit [Ping timeout: 240 seconds]
nowhereman_ has quit [Read error: Connection reset by peer]
nowhereman_ has joined #lisp
xrash has joined #lisp
fikka has joined #lisp
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
nowhereman_ has quit [Read error: Connection reset by peer]
nowhereman_ has joined #lisp
nowhere_man has joined #lisp
nowhereman_ has quit [Ping timeout: 240 seconds]
Zhivago has quit [Ping timeout: 256 seconds]
karswell_ has quit [Ping timeout: 252 seconds]
Orion3k has joined #lisp
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
z3t0 has quit [Ping timeout: 252 seconds]
rumbler31 has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Ping timeout: 240 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
d4ryus1 has joined #lisp
dieggsy has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
d4ryus has quit [Ping timeout: 268 seconds]
pagnol has quit [Ping timeout: 252 seconds]
<jack_rabbit> o/
Pixel_Outlaw has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has joined #lisp
pjb has quit [Ping timeout: 255 seconds]
damke_ has joined #lisp
al-damiri has quit [Quit: Connection closed for inactivity]
damke has quit [Ping timeout: 264 seconds]
loli has quit [Quit: WeeChat 2.0.1]
loli has joined #lisp
Cymew has joined #lisp
dddddd has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 240 seconds]
dieggsy has quit [Remote host closed the connection]
Cymew has joined #lisp
pjb has joined #lisp
pjb is now known as Guest4756
Oladon has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
Cymew has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
FreeBirdLjj has joined #lisp
sjl has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
sjl has quit [Ping timeout: 240 seconds]
Cymew has quit [Ping timeout: 252 seconds]
smasta has joined #lisp
zazzerino has quit [Ping timeout: 240 seconds]
Guest4756 has quit [Ping timeout: 240 seconds]
Zhivago has joined #lisp
marusich has joined #lisp
Chream_2 has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Chream_ has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
dieggsy has joined #lisp
dieggsy has quit [Client Quit]
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
dieggsy has joined #lisp
pierpa has quit [Quit: Page closed]
z3t0 has joined #lisp
<beach> Good morning everyone!
LocaMocha has joined #lisp
erikc has quit []
LocaMocha is now known as Sauvin
fikka has quit [Ping timeout: 240 seconds]
<iqubic> Morning Beach.
<iqubic> I hope your day has been well.
Pixel_Outlaw has quit [Quit: Leaving]
fikka has joined #lisp
Bike has quit [Quit: Lost terminal]
schoppenhauer has quit [Ping timeout: 248 seconds]
<beach> iqubic: Yes, thanks, but it has only lasted for an hour or so.
schoppenhauer has joined #lisp
oleo has joined #lisp
heurist_ has joined #lisp
heurist`_ has quit [Ping timeout: 268 seconds]
igemnace has quit [Quit: WeeChat 2.0.1]
dented42 has joined #lisp
xrash has quit [Read error: Connection reset by peer]
zooey has quit [Ping timeout: 255 seconds]
zooey has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
turkja has joined #lisp
Oladon has quit [Quit: Leaving.]
dieggsy has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
smurfrobot has joined #lisp
Chream_2 has quit [Ping timeout: 248 seconds]
Chream_ has joined #lisp
Chream_2 has joined #lisp
fortitude has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Ping timeout: 256 seconds]
Chream_ has quit [Ping timeout: 240 seconds]
<iqubic> Oh, I see.
<iqubic> I thought you were doing the thing where it's always "morning" when you enter an IRC channel and "night" when you leave.
oleo has quit [Quit: Leaving]
fortitude has joined #lisp
dieggsy has joined #lisp
dieggsy has quit [Client Quit]
lnostdal has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 264 seconds]
damke has joined #lisp
dieggsy has joined #lisp
fikka has joined #lisp
makomo has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
shka has joined #lisp
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
z3t0 has quit [Ping timeout: 240 seconds]
windblow has joined #lisp
dieggsy has quit [Ping timeout: 252 seconds]
<beach> Wow, more offers to help me with the work on SICL. Perhaps I should convert to being a project manager instead of writing the code myself.
<whoman> yeah! i think it is a good idea.
<whoman> i've coded enough in my time i should be consulting rather than coding myself .. hmm
<beach> I have always explored the design space by writing code, so that would have to change. Or at least, I would have to stick to small code snippets for showing the consequences of some particular design decision.
<whoman> hmm makes sense. architecting the garden geometry itself rather than tilling and plotting and weeding
<beach> Sort of, yes.
<whoman> oh, meta programming. program the programmers
<whoman> real life macro
<pillton> That is actually a better definition of the term meta programming.
<phoe> why program the programs if you can program the programmers
Karl_Dscc has joined #lisp
Orion3k has quit [Remote host closed the connection]
d4ryus1 is now known as d4ryus
ninegrid has joined #lisp
rumbler31 has joined #lisp
<cess11> because the programs are more obedient
vlatkoB has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
smasta has quit [Ping timeout: 252 seconds]
marusich has quit [Ping timeout: 252 seconds]
marusich has joined #lisp
mishoo_ has joined #lisp
whoman has quit [Remote host closed the connection]
heurist_ is now known as heurist
whoman has joined #lisp
marusich has quit [Ping timeout: 252 seconds]
marusich has joined #lisp
chens has joined #lisp
heurist` has joined #lisp
heurist has quit [Ping timeout: 240 seconds]
dec0n has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
flamebeard has joined #lisp
smurfrobot has joined #lisp
fikka has joined #lisp
sjl has joined #lisp
smurfrobot has quit [Ping timeout: 252 seconds]
sjl has quit [Ping timeout: 256 seconds]
Karl_Dscc has quit [Remote host closed the connection]
smurfrobot has joined #lisp
scymtym has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 240 seconds]
Chream_2 has quit [Ping timeout: 268 seconds]
rumbler31 has joined #lisp
smasta has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
smasta has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 256 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chens has quit [Remote host closed the connection]
chens has joined #lisp
dented42 has joined #lisp
dented42 has quit [Client Quit]
dented42 has joined #lisp
<shka> hello
<shka> how should i call category of data structures that are sequences?
<shka> as in: defclass
smurfrobot has joined #lisp
<shka> so i should not try to use 'sequence' because it is taken by cl itself
chens has quit [Remote host closed the connection]
<phoe> ds:sequencec
<phoe> I mean, ds:sequence
<phoe> or, simply use an implementation that allows you to extend CL:SEQUENCE, see http://www.doc.gold.ac.uk/~mas01cr/papers/ilc2007/sequences-20070301.pdf
<shka> uh, none of the options provided is actually good
fikka has joined #lisp
<shka> whatever
<phoe> but some are/will be better than others for what you are doing.
<phoe> your decision. (:
smurfrobot has quit [Ping timeout: 252 seconds]
dtornabene has joined #lisp
pfdietz has quit [Ping timeout: 256 seconds]
pfdietz has joined #lisp
varjag has joined #lisp
windblow has quit [Quit: windblow]
Ven`` has joined #lisp
shrdlu68 has joined #lisp
Cymew has joined #lisp
marusich has quit [Ping timeout: 252 seconds]
marusich has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
scymtym has joined #lisp
shka has quit [Ping timeout: 252 seconds]
<beach> Let's suppose I have an initial executable containing the image of a minimal Common Lisp system. In particular, it does not contain an evaluator. Now, I can cross compile DEFMETHOD forms so that the result is in a FASL file that can be loaded into that minimal image.
<beach> The code for a method has already been processed by MAKE-METHOD-LAMBDA, so the METHOD-FUNCTION of the method already contains definitions of NEXT-METHOD-P and CALL-NEXT-METHOD (we assume the default situation where a method function is called with a list of arguments and a list of next methods).
<beach> So, in this minimal image, I must be able to call the applicable methods according to the method combination of the generic function. I can't really call COMPUTE-APPLICABLE-METHODS or COMPUTE-APPLICABLE-METHODS-USING-CLASSES each time I call a generic function, because these are generic functions as well, so I would get into an infinite computation.
<beach> But in SICL, I have a call history in every generic function. It contains a list of pairs (S,E) where S is a signature consisting of classes of specialized arguments that have already been seen, and E is something that we can call an "effective method function".
<beach> It is not an "effective method" because that term is define in the AMOP to be a form that needs to be converted by the evaluator to a function. Now, after some methods have been loaded from FASL files, I need to be able to take them into account when I call the generic function.
<beach> So when the call fails because the call history does not contain an existing pair that will do, I need to compute a new such pair. But I can't do that by calling COMPUTE-EFFECTIVE-METHOD, because the result of such a call would have to be evaluated. So here is my tentative solution that I would like comments on:
<beach> In the initial image, when a call to a generic function fails because there is no appropriate pair in the call history, I create a new one as follows: I call COMPUTE-APPLICABLE-METHODS-USING-CLASSES and perhaps also COMPUTE-APPLICABLE-METHODS as usual. Then, instead of calling COMPUTE-EFFECTIVE-METHOD, I call a different SICL-specific function called (say) COMPUTE-EFFECTIVE-METHOD-FUNCTION.
<beach> It takes the applicable methods and returns a closure that can be used as the E component of the pair. The CODE for that closure is already in the image, so it is compiled. Therefore, creating the effective method function does not require any evaluator. Does this sound right, or am I missing something?
<beach> Sorry for the long rant.
fikka has joined #lisp
<beach> But it is quiet here, and it is on topic, so I guess it is OK.
smasta has joined #lisp
Cymew has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 240 seconds]
fdfdf has joined #lisp
solyd has joined #lisp
Chream_ has joined #lisp
<TMA> mop COMPUTE-EFFECTIVE-METHOD
<scymtym> beach: are the individual precompiled method functions compiled with particular lexical function bindings for NEXT-METHOD-P and CALL-NEXT-METHOD that are aware of this scheme?
<beach> I don't think they have to be.
<beach> When a method is defined, MAKE-METHOD-LAMBDA is called to create a "method function".
<beach> That method function, by default, takes a list of arguments to the generic function and a list of next methods.
<beach> So, the cross compiler has already inserted definitions of NEXT-METHOD-P and CALL-NEXT-METHOD.
<scymtym> sure, i was uncertain whether the way in which the list of next methods is passed is compatible between this scheme and the scheme eventually used once the compiler becomes available
<beach> Yes, that would be the same scheme, at least by default.
<scymtym> ok
<beach> But later on, I will specify optimized versions for standard generic functions, so the methods would then have to be compiled again.
<scymtym> i see
<beach> Once I have the compiler in the image, I can ditch the first-class global environment that has been used for the initial image, and create a completely new first-class global environment that contains optimized versions of everything.
<beach> Well, not "ditch". It has to be kept around, but I can start a new one from scratch.
nowhere_man has quit [Ping timeout: 264 seconds]
<scymtym> i will have to read more about the bootstrapping procedure to understand why that couldn't be done in the host lisp
<beach> It probably could.
<beach> But I want to keep the initial image as simple as possible.
damke_ has joined #lisp
Cymew has joined #lisp
<dim> what's the advantage of that design choice?
<beach> The simple image?
<beach> Or more generally?
wigust has joined #lisp
chens has joined #lisp
dec0n_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
<dim> the very simple image that depends on possibly nothing from the host? do you want to be able to bootstrap SICL from itself someday? I mean we have quite advanced Open Source standard CL implementations around that you could choose to depend on?
fikka has quit [Ping timeout: 248 seconds]
<beach> The executable image is supposed to be a complete Common Lisp implementation, so it can't depend on any existing implementation. The host Common Lisp system, used to cross compile code to generate SICL FASLs and to create the initial image can in theory be any conforming Common Lisp implementation that also supports closer-mop.
lnostdal has joined #lisp
dec0n has quit [Ping timeout: 240 seconds]
<beach> So, yes, I do depend on existing Common Lisp implementations for bootstrapping.
<beach> I am not sure that answers your question, though. :(
<dim> I think it does
<beach> Whew! :)
<dim> the simple image you're talking to is its own thing, you cross-compile it but then it runs by itself, without the need of any CL host around, right?
<beach> Correct.
<dim> ok I didn't understand that from reading you here before ;-)
<beach> Sorry! It is hard for me to describe something that I have been so familiar with for such a long time.
<dim> sure
<dim> I though SICL was about offering pieces of CL implemented in CL, following the metamodular idea, so that if e.g. an implementation has loop and other things but not CLOS, it could use SICL implementation of CLOS
<dim> or the other way around, provide CLOS and then get loop from SICL
<dim> didn't understand that you want to produce a full CL image from SICL sources, and now the whole bootstrapping idea makes more sense
hhdave has joined #lisp
<Shinmera> SICL's LOOP uses LOOP, if I remember correctly
<Shinmera> So it can't be used as a "plug in" source for features.
<dim> so can you compile the SICL image from CL+SICL, then use this first SICL image to compile SICL again, and then use that second SICL image as a CL compiler/env?
<dim> I think that's the classic compiler bootstrapping, in 3 stages, right? (I kind of remember that from classes ~20 years ago)
Chream_2 has joined #lisp
<beach> Shinmera: Correct, and it uses CLOS as well, which uses LOOP.
<beach> dim: Sure, that's pretty much the plan.
Chream_ has quit [Ping timeout: 240 seconds]
<beach> dim: My initial plan was to define some kind of order between modules, so that one could start with some minimal Common Lisp implementation and then load modules in that order. However, that turned out to be too painful because one would have to keep track of what subset of Common Lisp to use for each module.
<beach> Also, the maintainability of the code would suffer from not being able to use the full language. So I abandoned that idea.
fikka has joined #lisp
dddddd has joined #lisp
windblow has joined #lisp
Cymew has quit [Remote host closed the connection]
Cymew has joined #lisp
<dim> yeah, and it's not like you are pioneering CL anymore, you can trust/depend on having a good solid first implementation of the standard to use ; hell you even have a choice of Open Source solutions
<beach> Exactly.
Ven`` has quit [Ping timeout: 240 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dmiles> How does SICL do on cl-ansi ?
<dmiles> well i mean ansi-tests
<beach> SICL doesn't exist, so currently it is not doing anything at all.
smasta has joined #lisp
<dmiles> What do you mean by not existing?
<dmiles> (not finished with the impl of SICL to have it run the tests?)
<beach> There is not an executable file named `sicl' that you can start by typing `sicl' to your shell prompt.
<beach> And there is currently no way of producing such an executable.
nirved has joined #lisp
<dmiles> ah.. so right now one doesnt build an image that has a REPL ?
<beach> It doesn't build an image at all.
smasta has quit [Ping timeout: 240 seconds]
<dmiles> ah I thought it was when you said the executable image is supposed to be a complete Common Lisp implementation, so it can't depend on any existing implementation.
TMA has quit [Ping timeout: 256 seconds]
hhdave has quit [Ping timeout: 268 seconds]
Ven`` has joined #lisp
<beach> I may have used present tense rather than future tense
TMA has joined #lisp
<dmiles> naw you been using future tense correctly.
<beach> It becomes too boring to write things like "the executable image (should I live long enough to make the bootstrapping procedure complete enough that such an image might actually work)...."
<dmiles> *nod*
TMA has quit [Ping timeout: 248 seconds]
<dim> but at least you have a vision to share ;-)
<beach> And a plan.
<dim> and a plan, at that
<dim> so SICL is about being able to write a full CL implementation in (only) CL, and with native first-class environments and some other nice improvements to the current standard, is that right?
smurfrobot has joined #lisp
<beach> Right. The first-class global environments were invented mainly for the purpose of bootstrapping, but they can obviously be used for other purposes like sandboxing.
smurfrobot has quit [Remote host closed the connection]
<beach> There are very few "improvements to the standard". Mainly implementation techniques that I hope will be better than what currently exists. Like the fast dispatch technique, and the implementation of the sequence functions.
TMA has joined #lisp
hhdave has joined #lisp
Tobbi has joined #lisp
<dim> in my book having generic “APIs” over sequences and streams (ala grey streams but natively so) and maybe hash table functions would be significant improvements to the standard “grey areas” (pun intended)
<dim> (maybe s/grey/gray/)
_cosmonaut_ has joined #lisp
<dim> but well I don't have a solid book about CL (yet?) anyway ;-)
orivej has joined #lisp
<beach> Sure, those improvements are not terribly difficult.
<dim> I wonder if stream level abstractions make sense for higher level (network) protocols, such as MySQL or PostgreSQL protocols
<Shinmera> Having a streams API for arbitrary element types would be neat.
Kaisyu has joined #lisp
Intensity has quit [Remote host closed the connection]
smurfrobot has joined #lisp
Chream_2 has quit [Read error: Connection reset by peer]
zooey has quit [Ping timeout: 255 seconds]
misv has quit [Ping timeout: 240 seconds]
misv has joined #lisp
chens has quit [Remote host closed the connection]
mishoo_ has quit [Quit: (save-lisp-and-die)]
zooey has joined #lisp
smurfrobot has quit [Ping timeout: 264 seconds]
Chream_ has joined #lisp
mishoo has joined #lisp
<jdz> Shinmera: you mean records?
<jdz> Or binary/characters?
TMA has quit [Ping timeout: 248 seconds]
funnel has quit [Ping timeout: 260 seconds]
TMA has joined #lisp
damke has joined #lisp
TMA has quit [Ping timeout: 265 seconds]
<Shinmera> I mean being able to use streams for stuff other than integers and characters.
funnel has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
<beach> Like functions?
<Shinmera> For instance you could model exchange protocols with streams that emit objects representing messages.
<Shinmera> So you could hide the wire details away.
smasta has joined #lisp
TMA has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
smasta has quit [Ping timeout: 260 seconds]
<Shinmera> Would require a generic read-stream function to really be useful though.
smurfrobot has joined #lisp
markong has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
ebrasca has joined #lisp
ghard has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
sjl has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ebrasca> How to translate "(sum & 1)" to lisp?
<Shinmera> That depends on what it's supposed to mean
pok has quit [Quit: leaving]
<loke> ebrasca: Is that C?
<loke> Then it's (logand sum 1)
sjl has quit [Ping timeout: 240 seconds]
<ebrasca> It come from http://termbin.com/l3vi probably it is C.
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
<Shinmera> (ldb (byte 1 0) sum) may or may not be a more clear way to write it.
fikka has quit [Ping timeout: 252 seconds]
<ebrasca> I have write http://termbin.com/b11k but for some reason don't give expected checksums.
pok has joined #lisp
fikka has joined #lisp
m00natic has joined #lisp
<stylewarning> ebrasca: if you’re using SBCL there’s a dedicated function for that in the module SB-ROTATE-BYTE
<ebrasca> stylewarning: I am implementing FAT32 for mezzano OS.
rumbler31 has joined #lisp
<stylewarning> ebrasca: then it might be worth abstracting it into a portable function and implementing the assembly code for it! :D
Guest93224 has joined #lisp
smasta has joined #lisp
<stylewarning> ROL or ROR instructions
damke has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
damke_ has quit [Ping timeout: 264 seconds]
smasta has quit [Ping timeout: 252 seconds]
makomo has quit [Ping timeout: 240 seconds]
Orion3k has joined #lisp
Cymew has quit [Remote host closed the connection]
attila_lendvai has quit [Quit: Leaving.]
fikka has quit [Ping timeout: 265 seconds]
fikka has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
papachan has joined #lisp
shifty has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
<ebrasca> Yea my checksum work . First working version http://termbin.com/1p42
<ebrasca> Shinmera , loke and stylewarning : Thanks you.
fikka has joined #lisp
Chream_ has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 240 seconds]
billitch has joined #lisp
sz0 has joined #lisp
eminhi has joined #lisp
Cymew has joined #lisp
fikka has joined #lisp
wxie has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
wxie has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
Guest93224 has left #lisp [#lisp]
smasta has joined #lisp
pjb has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
smasta has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
EvW1 has joined #lisp
iqubic has quit [Ping timeout: 252 seconds]
raynold has quit [Quit: Connection closed for inactivity]
red-dot has joined #lisp
smurfrobot has joined #lisp
shrdlu68 has quit [Ping timeout: 240 seconds]
chenbin has joined #lisp
<chenbin> emacswiki's install-elisp and melpa's package-archives, which is
<chenbin> suggested?
<Shinmera> Try #emacs
chenbin has left #lisp ["ERC (IRC client for Emacs 24.5.1)"]
shifty has quit [Ping timeout: 268 seconds]
rpg has joined #lisp
zazzerino has joined #lisp
deng_cn has joined #lisp
rpg has quit [Client Quit]
solyd has quit [Quit: solyd]
megachombasss has joined #lisp
<megachombasss> hello guys. do you see any redundant code, errors, or things i could do in other way in this code? https://codepaste.net/bc72wz
<beach> Plenty.
<beach> Never put a parenthesis by itself on a line.
<beach> In fact, never put whitespace after ( or before ).
<beach> Use three semicolons on the top level.
<beach> Don't have blank lines inside top-level expressions.
<beach> Indent your code properly.
<beach> Don't use CamelCase. Use dashes to separate words in a name.
<beach> And use just lower-case symbols.
<beach> And it's a bad idea to use identifiers in some language other than English, especially if, like now, you want an international crowd to understand it.
<megachombasss> hum, could you give me an example of these error fix on one of my functions?
<beach> Don't use the "get-" prefix in Common Lisp. Don't use the "is-" prefix either. Use the "p" suffix instead.
<beach> Is it not clear what I mean?
<megachombasss> i have some troubles with english sorry
<beach> OK, let's start over.
<beach> Do you know what whitespace is? Like blanks, tabs, and newlines?
<megachombasss> whitespace yes
<beach> Never put one of those before a closing parenthesis or after an opening parenthesis.
<beach> In particular, do not put a closing parenthesis on a line by itself.
<megachombasss> okey. what abou three semicolons on the top level
<megachombasss> i dont understand that
<beach> You have ;; ******** Fonction pour ....
<beach> You should have ;;; ******* Function for....
<beach> With three semicolons.
<megachombasss> what does it change?
solyd has joined #lisp
<beach> It will then follow conventions.
<megachombasss> oh ok
<megachombasss> Don't use CamelCase. Use dashes to separate words in a name.
<megachombasss> dont understand that neither
<beach> Emacs indents three semicolons so that they are at the left margin, but two semicolons so that it is indented with the code.
<beach> CamelCase, is when you have a capital letter in the middle of a word, like resolutionEtiquette.
<beach> In Common Lisp, we don't use CamelCase. Use resolution-etiquette, or rather resolution-label instead.
<beach> Indent your code properly. Use an editor that knows about indentation.
<beach> For instance Emacs, SLIME, and the SLIME contribution called slime-indentation.
<paule32> hello
<paule32> (defvar *or-gate* (list a b d))
<paule32> (defun half-adder (a b d) (find *or-gate* (list a b d) :test #'equal))
<beach> megachombasss: Perhaps it is a problem with TAB characters. In that case, make sure you don't use TABs in the code.
<paule32> the result is always nil
<megachombasss> y i use mix of tab and space
<beach> megachombasss: Some paste services can handle it. Some others can't. It is best to avoid TABs.
<stylewarning> paule32: what are A B D?
solyd has quit [Client Quit]
<stylewarning> In the *or-gate*
<beach> stylewarning: You are wasting your time.
<stylewarning> Oh ok
<paule32> (defstruct wire (p1 100 :type integer))
<paule32> (defvar a (make-wire :p1 0))
<stylewarning> beach: how’s it going?
<beach> megachombasss: Don't use the "set-" prefix. Use a SETF function instead. LIke (defun (setf drapeaux) ...). Even better, (defun (setf flag) ...).
<paule32> (defvar b (make-wire :p1 0))
<beach> stylewarning: Fine thanks. And you?
<paule32> (defvar c (make-wire :p1 0))
<stylewarning> Well as well. Hope to chip away at some substantive ELS writing today
<beach> paule32: Stop it, please.
<beach> stylewarning: Excellent.
Ven`` has joined #lisp
rumbler31 has joined #lisp
<beach> megachombasss: So, fix the whitespace, the semicolons, the CamelCase, and the language, and then resubmit.
<megachombasss> got another question
<megachombasss> right now i have an error when i load this file
<megachombasss> says that i have a , before a backquote
<beach> megachombasss: Also, go read a text book on Common Lisp, and you will see how different their code looks from yours.
<megachombasss> hence it doesnt says where the error is
<megachombasss> so its like so hard to fix
ssake has joined #lisp
<stylewarning> megachombasss: is it hard to search for a misplaced ,?
<megachombasss> i dont have the contrl+Z
<megachombasss> so it can be anywhere
<beach> (format t "~%print pour make-hash-table ~a", <- there
dtornabene has quit [Remote host closed the connection]
<beach> megachombasss: What implementation of Common Lisp are you using that it doesn't tell you where it is?
<megachombasss> nvm, found it
<megachombasss> im using clisp 2.49
<beach> megachombasss: Most people here recommend SBCL, CCL, or ECL.
<beach> megachombasss: So if you want help, it is better to use one of the more widely used implementations.
<megachombasss> well, i have to use the one installed on university pc's
<megachombasss> oldshcool
<beach> What university is that?
<stylewarning> megachombasss: your CASE INST shouldn’t have the case clause symbols quoted
<Shinmera> You could try https://portacle.github.io, which will ship SBCL and should run without installation or admin privs.
<megachombasss> well, knowing i have only 1 day left for refactor this code , gonna be hard
windblow has quit [Quit: windblow]
<beach> Oh, so I am wasting my time. You are not going to want to learn Common Lisp after this assignment is due. I guess I'll go do something else then.
<megachombasss> tbh lisp itself doesnt interest me at all, knowing i have to do this project and teacher didnt give a single course on how lisp works
<megachombasss> we must do a lisp VM and a lisp COMPILER without a course of lisp
<Shinmera> Well you won't endear us to doing your course work for you
<stylewarning> megachombasss: Lisp is a wonderful language to write such things.
<megachombasss> nono, dont ask you to do my course work (as i literally had no courses about it)
<megachombasss> just you to see if there are things that can be made diferrently
<beach> You never told us what university this is.
<stylewarning> megachombasss: If you’re a beginning programmer, then the book Common Lisp: A Gentle Intro by Touretzky is a great book to teach yourself Lisp. If you know another programming language at an advanced level, then Practical Common Lisp is a great resource.
<stylewarning> megachombasss: unfortunately for beginners, it’s easy to write bad Lisp code, with poor efficiency, style, and use of the language features
openthesky has quit [Ping timeout: 260 seconds]
<paule32> stylewarning: https://pastebin.com/njYeQzyA
groovy2shoes has quit [Ping timeout: 276 seconds]
<beach> paule32: Why do you keep doing this? I don't understand.
<paule32> beach: i would ask, why the result of "compare" always is nil
<stylewarning> paule32: Write a function called GATE-EQUAL which tests if two gates are the same for your purpose. Happy to help after you’ve done that and can explain that function to me.
<beach> paule32: I am asking you why, despite being told an uncountable number of times, you continue submitting code that does not respect the conventions. I have told you over and over again that it is very impolite. And you keep right on doing it.
fikka has quit [Ping timeout: 252 seconds]
rumbler31 has quit [Remote host closed the connection]
Chream_ has joined #lisp
groovy2shoes has joined #lisp
muyinliu has joined #lisp
deng_cn has quit [Read error: Connection reset by peer]
mnoonan has quit [Remote host closed the connection]
deng_cn has joined #lisp
pfdietz_ has joined #lisp
Jesin has quit [Quit: Leaving]
KZiemian has joined #lisp
<KZiemian> hello world!
<KZiemian> do you know that book "Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS" by Sonya Keene is free to download
<KZiemian> or it need to be bought to read it with clear concience?
<KZiemian> I don't want steel work of better programer than me
pfdietz has quit [Ping timeout: 240 seconds]
<beach> Hello KZiemian. It didn't use to be downloadable. May it has changed.
Cymew has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<Xach> KZiemian: i am nearly certain it is not free to download
<KZiemian> Xach: thank you for information
smasta has joined #lisp
quazimodo has quit [Ping timeout: 260 seconds]
shrdlu68 has joined #lisp
Bike has joined #lisp
EvW1 has quit [Ping timeout: 252 seconds]
smasta has quit [Ping timeout: 240 seconds]
KZiemian has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
fittestbits has left #lisp [#lisp]
JonSmith has quit [Remote host closed the connection]
<megachombasss> https://codepaste.net/3nyez7 i dont manage to see where the hell he finds more than 2 params for the if?
<Bike> (if (gethash ...) (setmemoire ...) (gethash ...) (progn ...))
<Bike> four
<pjb> megachombasss: http://sprunge.us/gdaZ
dec0n has joined #lisp
<pjb> megachombasss: look at the parentheses under the IF. There should be only one or two!
<pjb> megachombasss: notice, if you used setf as I told you yesterday, and as I explain again in my sprunge, you wouldn't have to call gethash twice, since setf already returns the last value assigned!
<megachombasss> wait a sec, the source code of what you've sent me seems exactly as the same i using, hence the one im using wasnt that one
<megachombasss> so im refactoring a code that someone refactored of another code? dafuk
dec0n_ has quit [Ping timeout: 264 seconds]
<pjb> megachombasss: it looks like the code shown in the error message you get is expanded from a macro.
Guest95035 is now known as kolb
<pjb> megachombasss: have a look at: http://cliki.net/TutorialClispDebugger
<megachombasss> could you link me the source code of what you've sent me?
<Xach> megachombasss: who?
<pjb> megachombasss: when you get an error, you need to locate the source of the error; it's not always the form or the frame the debugger shows; you have to look up in the stack frames, to locate the actual source form or frame where the error occured.
<pjb> megachombasss: http://sprunge.us/gdaZ
<megachombasss> coz he may explain some fonctions i got no clue of what they do
<pjb> megachombasss: so in the case of your error, it's actually in case-saut!
<megachombasss> ye , but is that the only source? coz they should be more fonctions
<megachombasss> where did you get that from
<pjb> what?
<pjb> I get a lot of things from a lot of different sources.
thijso has joined #lisp
<megachombasss> well, the code you just pasted me, its exactly what i need. BUT, they should be more functions in that code
<megachombasss> so i was wondering where did you get that from
<pjb> megachombasss: I'm not rewriting your whole project! It comes from my brains!
deng_cn has quit [Read error: Connection reset by peer]
makomo has joined #lisp
<pjb> Youngsters these days! They believe things come from out there, from the Internet, instead of from the brains of somebody, including themselves!
<pjb> You are hopeless!
<Bike> well there's no case-saut in your paste
<megachombasss> oh wait a sec
quazimodo has joined #lisp
<megachombasss> so you actually wrote that from what i've sent earlyer?
<pjb> Bike: case-saut is in megachombasss's code.
<pjb> megachombasss: of course. It's a commentary on it.
<megachombasss> DAMN it, now i understand lol
<megachombasss> then im going to take a close look at it to see
<Bike> oh, there it is, my msitake
<Bike> looks kind of like the weird indentation makes it hard to see the broken if
dddddd has quit [Remote host closed the connection]
deng_cn has joined #lisp
<pjb> Well, I don't know, first thing I do when I load bad lisp code in emacs, is C-x h C-M-\
<pjb> and then M-x replace-regexp ) C-q C-j SPC * ) RET )) RET
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<pjb> How else could you read ita?
<pjb> s/a?/?/
fikka has joined #lisp
warweasle has joined #lisp
Murii has joined #lisp
proteanthread has joined #lisp
<megachombasss> i still have problems with this if clause. source : https://codepaste.net/rodwcr
<megachombasss> dont know why it says i have to much arguments for the if condition, when i have 2 in both of them
<beach> It looks like you didn't follow one single piece of advice I gave you.
<pjb> megachombasss: it should look like: http://sprunge.us/FKYI
<megachombasss> it isnt that, before putting it "on the clisp standard", i need that the code work first
<pjb> megachombasss: it can help to use emacs, with slime and paredit, so that indentation is performed automatically and correctly by emacs.
igemnace has joined #lisp
<beach> megachombasss: You don't understand. You are submitting your code for others to read. If you don't follow conventions, you are putting the burden on those other people, and that is VERY impolite.
<beach> megachombasss: Is this the first time you program?
<beach> ... in any language, I mean?
<megachombasss> pjb, the code you gave me is still giving me a IF error
<megachombasss> yes, i am experienced in other languages, c, c++, java , python
<beach> megachombasss: Then you know that if you want to communicate your code for others to read, it must have the correct indentation, spacing, naming convention, etc.
<pjb> megachombasss: for resetMemoire, you need &key or &optional: defun resetMemoire (&key (VM 'vm) (tmem 10000))
<pjb> megachombasss: I told you the IF error was in case-saut, not in case-other!
<megachombasss> ah, in case saut? let me check
<pjb> You don't even need to know how to read, just to copy-and-paste-and-search…
<ghard> sheesh :)
hiroaki has joined #lisp
Ven`` has quit [Ping timeout: 268 seconds]
Ven`` has joined #lisp
<megachombasss> well, give me a couple minutes that i fix all this mess, put it in decent clisp lookin, and i come back
<pjb> ok
<pjb> In universities, they should start by teaching emacs, as a prerequisite to any programming courses…
<dlowe> One of my "todo" projects is to make a really nice stand-alone source code formatter for CL.
<dlowe> If someone else wants to pick that up, it'd be great.
tenplaza9 has joined #lisp
rumbler31 has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
<pjb> Can be based on emacs, you can write stand alone scripts with emacs…
<ghard> Naah you cannot install emacs with npm :(
<pjb> Then it only means npm doesn't exist.
<ghard> It doesn't for me :)
tenplaza9 has left #lisp [#lisp]
<dlowe> One not based on emacs :p
<tazjin> @dlowe why would you want to reimplement everything emacs already has though?
safe has joined #lisp
<muyinliu> pjb: The Emacs stuff remind me of the early days...It's quite difficult to get used to Emacs.
<tazjin> writing executable elisp scripts is trivial and emacs is widely available (and much easier to install than npm and all the rest of that ecosystem)
<dlowe> tazjin: I wouldn't need everything emacs has, so I don't understand your question
<pjb> In typical programs, you don't use all of libc, but you still link with it..
<ghard> Things coud be worse - my daughter has her first programming course in the uni so I had to install netbeans on one of my boxen...
red-dot has joined #lisp
<muyinliu> ghard: What program language did she learn?
<ghard> The abomination - Java
deng_cn has quit [Ping timeout: 260 seconds]
<pjb> bah, java 8 has lambda…
<pjb> Be sure to show her FizzBuzz, Enterprise Edition…
<ghard> Guess so, but still I thought I left all that boilerplate behind in around 2001
<ghard> Call me again when java is homoiconic and has proper macros ;)
<pjb> I don't remember if FizzBuzz Enterprise Edition uses the Interpreter Pattern. Perhaps it can be improved…
smasta has joined #lisp
<megachombasss> well, i've fixed the error in case-saut
oleo has joined #lisp
<ghard> Thing is she's studying molecular biology, not CS so they don't care about programming hygiene
<megachombasss> therefore, event with your comments, i have high troubles understanding some of the transformations you recomend me to do
<megachombasss> so sir pjb, i would really need asistance of this. im whiling to pay if needed , but i really need to present something for tomorrow
<megachombasss> actually, my university career depends of this
<pjb> megachombasss: in C or C++, you would use a struct to define vm? Then use defstruct in CL!
<megachombasss> lisp is a pure nightmare for me
<pjb> megachombasss: it's really a programming language just like any other. Since you said you know already four of them, you should be able to jump into CL without any problem. There's nothing different.
<megachombasss> well actually so much parenthesis give headache
<megachombasss> im having more troubles with the language itself than with the VM
<pjb> Like in Java and Python, there are objects, classes, methods, a garbage collector.
<pjb> megachombasss: there are fewer parentheses in lisp than in C or worse, C++!
<ghard> megachombass: emacs is your friend if you have problems with counting parentheses
<pjb> (if you count {} [] <> as parentheses too, which you should0.
<zazzerino> megachombasss: the parenthesis are giving you a headache because you're not using an editor that can help you deal with them. You've already been told this but it didn't seem to get though- try using https://portacle.github.io/
<megachombasss> using gedit
<pjb> Well, no.
<megachombasss> not familliar with emacs, and those are the only few installed on these computers
<zazzerino> megachombasss: yes, and that's making things difficult for you
dec0n has quit [Read error: Connection reset by peer]
<pjb> megachombasss: but if you do, you use it wrong, because it features: * Bracket matching !!!!
moei has joined #lisp
fikka has joined #lisp
smasta has quit [Ping timeout: 264 seconds]
<pjb> megachombasss: furthermore, it even has a lisp syntax highlighting module: https://ubuntuforums.org/showthread.php?t=2253625
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<muyinliu> megachombasss: You REALLY need Emacs with rainbow-delimiters, take a look at this: http://pasteall.org/pic/index.php?id=123935
<zazzerino> Are there really universities that require Common Lisp for projects but don't allow students to install or use emacs? I find it hard to believe, but I didn't study programming in school...
rippa has joined #lisp
<ghard> Worse - dropping someone into CL straight from imperative languages without giving an initial course first.
<pjb> Universities let you use any tool you want in general.
ghard_ has joined #lisp
<rumbler31> There's no way this user hasn't had a lead up of some kind to have to use lisp for their final project. There's no fooling us in that regard. But it is not uncommon for departments to set up hosted machines where students must save and submit their work.
<rumbler31> in browser editor with paren matching. too easy
fikka has quit [Ping timeout: 248 seconds]
m00natic has quit [Read error: Connection reset by peer]
ghard_ has quit [Client Quit]
<rumbler31> ok i take that back, paren matching is a little weak, but
<rumbler31> but its got htat repl experience, using clisp 2.49
fikka has joined #lisp
sjl has joined #lisp
FreeBirdLjj has joined #lisp
dddddd has joined #lisp
<rumbler31> megachombasss: see my link
quazimodo has quit [Ping timeout: 246 seconds]
<muyinliu> rumbler31: This online-editor is quire poor, without auto-indent or colorful parentheses...
orivej has joined #lisp
<rumbler31> its not great. but its better than gedit, and I can't find the other ones that were fully featured
<sebastien_> which GTK+ binding would you recommend for a new application? cl-cffi-gtk or gtk-cffi?
<sebastien_> the difference between the two is not obvious at first glance, though cl-cffi-gtk seems more maintained
<zazzerino> sebastien_: I don't personally have experience with either, but I know nEXT browser (https://github.com/next-browser/next) uses cl-cffi-gtk
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<sebastien_> zazzerino: thanks for the data point
JonSmith has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<muyinliu> I wrote a Common Lisp CFFI wrapper for GraphicsMagickWand: https://github.com/muyinliu/cl-graphicsmagick
JonSmith has quit [Ping timeout: 276 seconds]
smurfrobot has joined #lisp
<rumbler31> thank you!
<muyinliu> And a CFFI wrap of fswatch, a cross-platform file change monitor: https://github.com/muyinliu/cl-fswatch
<rumbler31> I've always wanted to wrap native libs but it seems intimidating. how did you get started? did you leveerage any automatic header file parsing?
Ven`` has joined #lisp
<muyinliu> rumbler31: No...Only SWIG could be a little help :(
<zazzerino> rumbler31: cffi has excellent documentation. Something that's nice about wrapping libs in cl is you can do it interactively, and can start with just the functions you need.
<muyinliu> rumbler31: Mostly I wrote those CFFI wrapper by hand.
<Shinmera> rumbler31: Just type it out
<rumbler31> shinmera: speaking of which, I know that wrapping c++ libs is a different beast. how did you learn what you needed to know to make it happen?
<Shinmera> I did not
<Shinmera> If you do need to do it though the strategy is simple: write a C library that exposes all constructors, methods, functions, and structs. Then bind that. It's extremely tedious though, so I'd never do it myself.
<rumbler31> Er, well, what exactly did you do?
<muyinliu> zazzerino: The demo in CFFI's doc is not complete(especially about how to wrap Windows libs). I have to try my best to collect info from everywhere :(
<Shinmera> I never wrapped any C++ libraries
<muyinliu> rumbler31: Can't wrap C++ libs directly. Sadly.
<rumbler31> well I guess i didn't technically mean directly
orivej has quit [Ping timeout: 240 seconds]
<muyinliu> rumbler31: You have to write some C code to wrap C++ functions.
<pjb> OR, implement the name mangler of your C++ compiler.
<zazzerino> I found it useful to look at examples in the domain I'm currently working on (audio programming). Tito Latini wrote some relatively simple wrappers for a few c libs for his Incudine library. You can find them at https://sourceforge.net/p/incudine/incudine/ci/master/tree/contrib/
<zazzerino> won't help much with c++ libs, though...
<muyinliu> pjb: Is there any example?
<pjb> OR use clasp.
Cymew has quit [Remote host closed the connection]
<muyinliu> pjb: clasp...LOL
<Shinmera> What's "lol" about it
<pjb> the name :-)
brendyn has quit [Ping timeout: 252 seconds]
<Shinmera> Okey
Murii is now known as vnx
<rumbler31> shinmera: so what did you target to get access to qt?
<Shinmera> I didn't write CommonQt
<rumbler31> wow I could have sworn that was you
<Shinmera> I wrote Qtools.
<Shinmera> Anyway, even CommonQt didn't really bind C++, it used Smoke which is an autogenerated C wrapper for Qt.
saki has quit [Quit: saki]
Cymew has joined #lisp
<rumbler31> oh, thank you for clearing that up
<rumbler31> and on another note, I feel that linking c++ libs is more complicated than simply implementing the correct name mangling
<Shinmera> Well if you want dynamic dispatch you'll also need to implement how vtables work
<Shinmera> And if you want exception handling, you'll need to handle that as well (good luck with that one)
Orion3k has quit [Remote host closed the connection]
<Shinmera> But, even with just name mangling (and thus static dispatch) you can get pretty far.
Cymew has quit [Ping timeout: 240 seconds]
<rumbler31> so if you want to call a constructor for classes with heirarchies and dynamic dispatch, you have to do all that yourself, call the base class constructors in order, wire up the vtables.
<Shinmera> if I remember correctly constructors are override unless they explicitly call super or whatever, so you don't need to implement that bit.
Cymew has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
orivej has joined #lisp
<rumbler31> so objects store virtual methods as pointers to a central vtable, right?
<rumbler31> ahh i'll go google it
smurfrobot has quit [Remote host closed the connection]
alexmlw has joined #lisp
Cymew has quit [Ping timeout: 264 seconds]
Cymew has joined #lisp
proteanthread has quit []
Cymew has quit [Ping timeout: 240 seconds]
BitPuffin has joined #lisp
<beach> It would probably be faster to use my generic dispatch technique than to use vtables.
<Shinmera> Yeah, if you replicate the type hierarchy on the lisp side you can implement the dispatch yourself.
<Shinmera> Well, the type hierarchy and method attachment (which classes even define a method of their own)
<beach> It would be somewhat ironic, though, if the fastest C++ implementation would use a dispatch technique from Common Lisp.
<Shinmera> Wasn't there a JS compiler in CL that was faster than browser engines at the time
<beach> Possibly. I don't think I ever kept track of JavaScript stuff.
<Xach> cl-js is cool but even when new was a generation behind in performance
<Xach> i would still like to use it to try to make a js interface for non-cl users to customize cl software.
<rumbler31> that doesn't help if the library code needs to call the virtual methods, does it?
<Shinmera> the library code will use whatever's baked in to the library.
vlatkoB_ has joined #lisp
vlatkoB has quit [Read error: Connection reset by peer]
igemnace has quit [Read error: Connection reset by peer]
<rumbler31> if library code calls a virtual method on an object you passed it, the resolution of the final function call comes from a callback in lisp, right?
<Shinmera> No, why?
igemnace has joined #lisp
zaquest has quit [Read error: Connection reset by peer]
<pjb> megachombasss: https://pastebin.com/7pTwi9fh
<Bike> making generic functions static seems like a bit of an endeavor. And you'd either get a combinatorial explosion or have to assume some aspects of the class hierarchy don't change (you have to assume that anyway, of course)
<rumbler31> because the object has a pointer to the vtable, if the library code makes calls to virtual functions, the compiler would have baked in the pointer lookups to the correct call. so what gets given to the library would need to be an object with a pointer to a table of function pointers, and if those pointers resolve to functions in lisp then they'd need to be callbacks
<Shinmera> rumbler31: I'm not talking about allowing you to add methods from the lisp side.
<Shinmera> just replicating the dispatch that is already present in the library.
<Shinmera> to avoid having to know about the vtable layout.
<rumbler31> but doesn't library code making those calls need that information?
<Shinmera> that's already baked into the library. How else could it possibly function?
milanj has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kaisyu has quit [Quit: Connection closed for inactivity]
<rumbler31> I've typed up several lines. But the only common response among them is "I don't know"
saki has joined #lisp
<Shinmera> That's because it doesn't function otherwise.
<Shinmera> I don't know how exactly it works in C++, but typically a method call with dynamic dispatch works as follows: dereference the object to get the vtable, load the value from a fixed offset in that table for the specific method you want to call, then simply call that value (address) with the rest of the arguments.
<Shinmera> The vtable is part of the static memory allocated by the library.
<rumbler31> I must be reading too much into what you said earlier.
<rumbler31> but that answers a few questions
<Shinmera> If you know 1) what the class hierarchy is 2) which classes define which methods, and 3) what type an object has at runtime, you can replicate the dispatch without needing to even look at the vtable.
<Shinmera> Or the object's storage for that matter.
<rumbler31> ohhhhh
hiroaki has quit [Ping timeout: 240 seconds]
<rumbler31> hold pointers to the library methods in lisp, dispatch in lisp to the correct calls
<Shinmera> Yes.
<beach> ... which would also be faster than what the library does. :)
Chream_ has quit [Read error: Connection reset by peer]
solyd has joined #lisp
<rumbler31> I mistakenly assumed that the runtime is responsible for wiring up the vtable
turkja has quit [Ping timeout: 240 seconds]
<beach> You attribute way too much dynamic behavior to C++, I think. :)
<rumbler31> lol indeed
Chream_ has joined #lisp
<TMA> beach: not necessarily faster. it is three instructions (two memory fetches and one indirect call) in the case of single inheritance; it is more involved in the multiple inheritance case and in case of virtual base classes, but it is hard to beat the performance of the simple case
<Shinmera> I think beach's method can be faster because it does no memory fetches.
<beach> TMA: Someone would have to verify that. But it won't be me. :)
zooey has quit [Ping timeout: 255 seconds]
flamebeard has quit [Quit: Leaving]
makomo has quit [Ping timeout: 240 seconds]
Chream_2 has joined #lisp
Chream_ has quit [Ping timeout: 240 seconds]
zooey has joined #lisp
Folkol has joined #lisp
<TMA> beach: I think I have read someone verifying the speed of lisp's generic function dispatch and c++ vtable lookup dispatch, but that was a long time ago and moreover not entirerly the same thing. (so yes, someone would have to verify that)
raynold has joined #lisp
<beach> If you read it a long time ago, then the Common Lisp way was using hash tables which is slower than my technique.
<zazzerino> Does anyone know of a common lisp library similar to clojure's hugsql? (https://github.com/layerware/hugsql)
<rumbler31> beach: where can I read about your technique
Folkol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rumbler31> ty
<beach> ywlcm
<beach> rumbler31: scymtym has some benchmarks showing that it is significantly faster than the PCL technique, which is used by SBCL among others.
<rumbler31> sweet
<Shinmera> scymtym: Speaking of SICL dispatch in SBCL, what are the roadblocks to getting that merged in?
attila_lendvai has quit [Quit: Leaving.]
iqubic has joined #lisp
<Shinmera> Or completed
<iqubic> Does slime require internet access to work?
<scymtym> Shinmera: plenty. i don't have time right now, but i can write down a list later
<beach> Shinmera: The SICL technique as documented requires classes to have unique numbers (that change when the class is redefined). SBCL doesn't have that. So, as I recall, scymtym is using the address of the class metaobject instead.
<rumbler31> iqubic: no but installing anything with quicklisp might, such as the slime-helper
<beach> But that requires the class not to move as a result of a GC.
<Shinmera> beach: Right
<iqubic> rumbler31: That's what I figured.
<beach> Shinmera: So, either you convince the SBCL maintainers to introduce class numbers, or you make them swear that classes will never move. None of which is going to happen.
<rumbler31> iqubic: or more esoterically, if for some reason you've brought your loopback interface down, you'll have silent errors that will confound you for a little while, so don't do that ;-)
<scymtym> beach: it's more nuanced than that in both regards. as i said at time, the benchmarks are not ideal and it cannot be concluded that (my variation of) fastgf is significantly faster in all cases. secondly, the dispatch i implemented uses multiple kinds of decisions, based on lowtags, widetags, layout addresses, EQ-comparisons and EQL-comparisons
<rumbler31> iirc the symptom is that there is no error when opening the socket, so swank starts fine, but nothing can connect, so slime connect fails.
<beach> scymtym: Sure. I just gave him the big picture. I hope it was not completely wrong.
<iqubic> What does loopback mean?
<iqubic> IDK what that even is.
<iqubic> Is there a better way to do this: (apply #'+ (number-sequence 1 100))?
<rumbler31> ifconfig lo0
<iqubic> I feel like I have to use apply to pass a list into +.
<loli> well you could use reduce as well
<iqubic> that seems like such a common design thing.
<iqubic> loli: My main issue is wanting to pass a list to a function that only takes &rest params.
<iqubic> Is there a macro for that?
<Bike> nope, that's what apply is for
<Shinmera> clhs apply
<scymtym> beach: it wasn't, of course. and i'm not denying that fastgf is or can be faster than PCL. in fact i believe that is the case. i'm just saying that the benchmarks i did so far are not sufficient evidence for that conclusion
<beach> scymtym: Fair enough. I'll quit saying that. :)
<Bike> (apply #'+ (number-sequence 1 100)) can be better done as (/ (+ (* 100 100) 100) 2), natch
<shrdlu68> iqubic: #'reduce
<scymtym> beach: ok
<beach> scymtym: Do you share my sentiment that it would be hard to convince the SBCL maintainers to do what it takes to support a good version of my dispatch technique?
<iqubic> shrdlu68: I know how reduce works.
<Bike> reduce works if the function is associative and such, but in general, if you have a list you want to pass to a function as arguments, that is what apply does
<iqubic> Well, I have class now. I have to go. Bye all.
<Bike> good-bye
<iqubic> Sorry I couldn't stay for long.
<iqubic> I didn't track the time closely.
<iqubic> LOL
<scymtym> beach: since i am an SBCL maintainer, i could, in theory, undertake that myself and i don't think anybody would object. that said, this would probably be the biggest and most invasive change since i started working on SBCL and i often had trouble getting much smaller things to a point where i could merge them
<beach> Yes, I see. Makes sense.
<Bike> i was under the impression that sbcl classes had "layouts" that can be used similarly for obsolete instances. could you see how it goes just using eq comparisons of those instead of small integers?
<scymtym> beach: maybe when some other implementation completely embarrasses SBCL in terms of generic dispatch performance, stassats could become interested
<beach> scymtym: Heh, yes, maybe so.
<scymtym> Bike: EQ-comparisons do not allow for unrolled binary search, though
iqubic has quit [Ping timeout: 248 seconds]
<Bike> ...right.
<Bike> don't suppose you could just throw an integer into those
<scymtym> well, what i do is using layout addresses, saving a memory read
<scymtym> but only works when layouts are immobile
<scymtym> i think, layouts already have a CLOS hash or similar in them. so that could be used. but doing any sort of range optimization would be out of the question
* scymtym goes back to dayjob for real
<Bike> i'm not sure how important the range part is compared to the rest, really.
JonSmith has joined #lisp
Karl_Dscc has joined #lisp
JonSmith has quit [Ping timeout: 252 seconds]
z3t0 has joined #lisp
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
LiamH has joined #lisp
zaquest has joined #lisp
mathi_aihtam has joined #lisp
billitch has quit [Read error: Connection reset by peer]
mathi_aihtam has left #lisp [#lisp]
hhdave has quit [Ping timeout: 248 seconds]
sz0 has joined #lisp
smasta has joined #lisp
billitch has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
ebzzry_ has joined #lisp
<ebzzry_> Is there a structure that holds that exported symbols of a package?
<Xach> ebzzry_: probably. but not exposed by the standard.
<ebzzry_> Xach: ok
smurfrobot has joined #lisp
smasta has quit [Ping timeout: 264 seconds]
_cosmonaut_ has quit [Ping timeout: 252 seconds]
smasta has joined #lisp
<Bike> you can iterate over them though.
fikka has quit [Ping timeout: 240 seconds]
drewc_ has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
megachombasss has quit [Ping timeout: 260 seconds]
drewc has quit [Ping timeout: 240 seconds]
shka has joined #lisp
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
MrBismuth has joined #lisp
MrBusiness has quit [Ping timeout: 265 seconds]
z3t0 has quit [Ping timeout: 268 seconds]
Chream_2 has quit [Read error: Connection reset by peer]
mathi_aihtam_ has joined #lisp
Chream_ has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
vnx is now known as Murii
troydm has joined #lisp
hiroaki has joined #lisp
eminhi has quit [Quit: leaving]
<rumbler31> warweasle: did you get that serial bridge up and running?
igemnace has joined #lisp
vap1 has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
eivarv has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
<warweasle> rumbler31: They didn't want to take time to make it. Programmer's will just have to walk to the lab.
hiroaki has quit [Ping timeout: 246 seconds]
<rumbler31> darn
smurfrobot has quit [Remote host closed the connection]
zazzerino has quit [Remote host closed the connection]
rpg has joined #lisp
hiroaki has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
shka has quit [Read error: Connection reset by peer]
shka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
<shka> good evening
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
smasta has quit [Ping timeout: 260 seconds]
shka_ has joined #lisp
shka has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
Sauvin has quit [Ping timeout: 240 seconds]
randomstrangerb has quit [*.net *.split]
ikopico has quit [*.net *.split]
ikopico has joined #lisp
randomstrangerb has joined #lisp
varjag has joined #lisp
josemanuel has joined #lisp
BitPuffin has quit [Remote host closed the connection]
orivej has joined #lisp
fikka has joined #lisp
mathi_aihtam_ has left #lisp [#lisp]
alexmlw has quit [Quit: alexmlw]
fikka has quit [Ping timeout: 240 seconds]
Chream_ has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
Chream_ has joined #lisp
Murii has quit [Quit: WeeChat 1.4]
shifty has joined #lisp
dented42 has joined #lisp
sz0 has quit [Quit: Connection closed for inactivity]
smurfrobot has quit [Remote host closed the connection]
makomo has joined #lisp
damke has quit [Ping timeout: 264 seconds]
hiroaki has quit [Ping timeout: 256 seconds]
smurfrobot has joined #lisp
damke has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jstypo has joined #lisp
smurfrobot has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
fikka has quit [Ping timeout: 256 seconds]
dented42 has joined #lisp
smurfrobot has joined #lisp
fikka has joined #lisp
smurfrobot has quit [Ping timeout: 260 seconds]
pagnol has joined #lisp
<Xach> ok
<Xach> Does anyone here have a project in quicklisp and want to monitor its build failures through RSS?
fikka has quit [Ping timeout: 276 seconds]
<dlowe> yes
<jasom> Is it possible to portably store a hash-table literal in a fasl?
igemnace has quit [Ping timeout: 265 seconds]
<shka_> jasom: what is hashtable literal?
<jasom> shka_: trivially #.(make-hash-table)
<jasom> shka_: obviously I want to do something slightly more complicated
<shka_> ok
<pjb> jasom: AFAIK, no problem.
<shka_> well i don't know
<dlowe> Xach: woo. Thanks.
<jasom> clhs 3.2.4.4
<specbot> Additional Constraints on Externalizable Objects: http://www.lispworks.com/reference/HyperSpec/Body/03_bdd.htm
<pjb> jasom: well, only abcl can't do it.
<jasom> ah 3.2.4.2.2 talks about similarity of hash-tables
hiroaki has joined #lisp
megachombas has joined #lisp
<jasom> but I don't see anywhere in 3.2 a list of object types that must be externalizable
<pjb> jasom: I guess you could write a make-load-form for hash-table. Also, the keys and values would have to be externalizable.
<jasom> which makes no sense because obviously CONS and symbol must be
ghard has quit [Read error: Connection reset by peer]
<pjb> jasom: only it's forbidden by 11.1.2.1.2 point 19…
<jasom> pjb: well if ABCL allows defining make-load-form and all other implementations don't need make-load-form, I have a workable solution
<megachombas> (setf a '(:@)) (format t "% print ~a" a) this return "@"
<megachombas> me no understand
<jasom> megachombas: ~a "pretty-prints" it's values, and so it omits the leading :
<megachombas> how to actually print EVERYTHING?
<pjb> jasom: consider using load-time-value instead of #.
<jasom> megachombas: use ~s if you want to show the representation of it
<jasom> pjb: of course, I was just showing a simple example to shka_
<pjb> megachombas: clisp only evaluates one form on a read line.
<pjb> megachombas: well, I'm wrong, it evaluates each form in turn.
<pjb> (setf a '(:@)) doesn't print anything and returns (:@)
* jasom understood megachombas's complaint to be that it printed "% print @"
fikka has joined #lisp
<pjb> (format t "% print ~a" a) prints % print (@) and returns NIL
<jasom> pjb: actually in this case load-time-value is the exact opposite of what I want. I want it to be evaluated at compile time, not at run-time.
<pjb> megachombas: also, you may want to finish output with a newline, and to flush the buffer with a call to (finish-output).
<pjb> jasom: then you need to be able to make-load-form if it's not present.
<megachombas> actually i want to know what is passed as param in a fuction, to be able to copy this parameter and load that fuction by hand
<megachombas> but seems something's fked up
<pjb> Notice that hash-tables have attributes that are not always visible, such as :size, :rehash-threashold, etc.
<Xach> megachombas: trace is quite handy for that.
shka_ has quit [Ping timeout: 240 seconds]
<pjb> megachombas: you can use print to debug.
<megachombas> thats what i did
<megachombas> print?
<megachombas> oh
<pjb> (defun foo (a b c) (print (list 'foo a b c)) …)
<megachombas> let me test with print
JuanDaugherty has joined #lisp
Cymew has joined #lisp
<pjb> megachombas: the advantage of print is that it returns its first argument so you can use it in expressions: (if (print (= (print a) (print b))) (print 'same))
fikka has quit [Ping timeout: 268 seconds]
<pjb> The inconvenient is that it only prints the argument, so if you have a lot of them it may be confusing.
<pjb> You can write your own debugging printing macro to add labels.
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pjb> I have a macro (com.informatimago.common-lisp.interactive.interactive:show expression) that prints expression = value and returns value so it can be used as print, but its output is clearer.
fiveop has joined #lisp
scymtym has quit [Ping timeout: 252 seconds]
Cymew has quit [Ping timeout: 240 seconds]
<megachombas> https://codepaste.net/b5g7ai says me variable list has no value
<pjb> megachombas: read again, and debug.
<megachombas> ive applied (defun foo (a b c) (print (list 'foo a b c)) …) to my example
<pjb> No, you haven't.
<megachombas> oh some parenthesis missing
<megachombas> like always
<pjb> megachombas: in C, would you write: print(list a,b,c) or print(list(a,b,c))? Would you forget the inner set of parentheses?
<pjb> It's the same in lisp!
solyd has quit [Quit: solyd]
<megachombas> something must be wrong in my reasoning
<megachombas> one sec
<pjb> (list 'foo a b c)
<pjb> megachombas: Call the function list with as arguments 'foo a b and c is written ( =call list 'foo a b c )=end of arguments.
<pjb> call print with as arguments (list 'foo a b c) is written (print (list 'foo a b c)) not (print list 'foo a b c)!
fikka has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
asarch has joined #lisp
JonSmith has joined #lisp
dented42 has joined #lisp
<megachombas> i guess im not captuing the exact value of asm with the print
<jasom> megachombas: you need to set *print-circle* to t
<jasom> Consider the output of this form with *print-circle* set to t and nil: (let ((x (gensym))) (list x x))
<megachombas> dont understand that print circle
<jasom> (eq #:foo #:foo) ;=> nil
orivej has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
<jasom> (eq #1=#:foo #1#) ;=> T
<jasom> whatever you are interacting with is generating output that includes uninterned symbols. These are confusing if you are new to lisp, so just enable *print-circle* for now if you want to be able to paste the output and have it read in correctly.
<megachombas> one sec
fiveop has quit []
<megachombas> https://codepaste.net/eomssv like this?
mishoo has quit [Ping timeout: 240 seconds]
<jasom> megachombas: no
<megachombas> god bless lisp
<jasom> megachombas: just set it to true at the toplevel before you run whatever it is that prints stuff out.
<TMA> megachombas: set *print-circle* to t === (setf *print-circle* t)
<megachombas> oh, print circle is a variable?
<jasom> yes *print-circle* is a variable
<jasom> it is false (nil) by default.
nowhere_man has joined #lisp
<jasom> you want (let ((*print-circle* t)) (list 'load-machine vm asm)))
<jasom> ah, I didn't see you had a print
<jasom> alksjfoidsamfiadm
drewc_ is now known as drewc
<jasom> you want (let ((*print-circle* t)) (print (list 'load-machine vm asm))))
JuanDaugherty has quit [Quit: Ex Chat]
<TMA> megachombas: the difference is that in the (let ((*print-circle* t)) (print (list 'load-machine vm asm)))) version you do not set the variable permanently, you change the value just for the print inside
<megachombas> well
<megachombas> with print circle it works
<megachombas> but ugly as fak
warweasle has quit [Quit: away!]
<jasom> megachombas: this is part of why it's off by default...
<megachombas> but
<megachombas> i still dont get it
<megachombas> let me show the compare
<jasom> megachombas: do you know any non-lisp programming languages?
<megachombas> c, c++, java, python
dented42_ has joined #lisp
<jasom> megachombas: okay, in C, will the following expressin be true or false: "foo" == "foo"
dented42 has quit [Ping timeout: 240 seconds]
<megachombas> true
ebzzry_ has quit [Ping timeout: 260 seconds]
<jasom> however this will always be false, right?: "foo" == strcpy("foo")
<TMA> megachombas: not necessarily. the standard permits it to be true, but does not mandate it
<jasom> megachombas: not necessarily; the compiler could in theory generate two different string literals and then it would be false because they would have different addresses
<megachombas> hum
<megachombas> it should be true, you copy "foo", so the strcpy is "foo" aint it?
<jasom> megachombas: nope in C == just compares the addresses that the string is stored at
<jasom> and a copy of the string will have a different address than the original string
<megachombas> ah true
<megachombas> i have to do string compare
<Shinmera> To compare contents you need strcmp
<megachombas> y y my bad
<jasom> right, when you read this in lisp, it will always generate an identical symbol named "FOO" in whatever the current package is. No matter how many times you read it, only one symbol will be created: 'foo
<jasom> same is true for keywords like :foo
<jasom> however, if you put #:foo it creates a new symbol with no package whatsoever. Since there is no package when you get another #:foo it creates another symbol with the same name, so you have two different symbols
<jasom> hence (eq :foo :foo) => T
<jasom> (eq #:foo #:foo) => nil
<jasom> now the reader has a specail tool that lets you drop objects that have already been read into the same place. You mark an object you want to include later With #N= (where N is a number) and then anywher thereafter you can put #N# and it drops the identical object there
<megachombas> hum
<megachombas> i plus or less get it
<jasom> so (eq #1=#:foo #1#) => T
<jasom> because you now have the same identical symbol
<Xach> Shinmera: I restructured things a little for the rss feeds. There's now http://report.quicklisp.org/feeds/author/Shinmera.rss as well as http://report.quicklisp.org/feeds/project/chirp.rss (for example)
<Xach> they include some of the log (the part immediately before and after the start of the backtrace)
<Shinmera> Xach: Seems sensible, thanks for the update.
dyelar has quit [Quit: Leaving.]
smurfrobot has joined #lisp
* Xach will add some finishing touches and write up the failfeeds
<megachombas> what i dont get
<megachombas> is that my function
<megachombas> when it evaluates every element of the list to perform actions on it
<megachombas> doesnt detect the ## and the random numbers that *print circle* adds
oleo has quit [Ping timeout: 252 seconds]
<Xach> megachombas: the important distinction between internal and external representation is at play here
<Xach> understanding it well helps a lot
<megachombas> because my objective is eliminate the function that generate that list, and directly read that list from a file
<megachombas> but with all the ## and numbers added, it doesnt loook great
<TMA> megachombas: do the labels need to be uninterned symbols?
<megachombas> what do you mean?
<TMA> megachombas: the #:|finTest7794| for example
<megachombas> well, pretty sure that isnt what i was expecting
<megachombas> its technically (@ labelname)
<megachombas> dunno wy lisp added that too
<megachombas> im getting so mad with lisp
zazzerino has joined #lisp
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
pagnol has quit [Quit: Ex-Chat]
<Shinmera> Well you're probably getting mad because you jumped right into the icey water and are now confused why it's so cold, instead of easing yourself in slowly.
<megachombas> all looks so difficult
<megachombas> i mean, the asm coded that is passed to my function is a lisp list
<Shinmera> Everything is difficult if you try to accomplish a non-trivial task in an unfamiliar environment.
<megachombas> still dont get why when i make this list by hand and pass it it fks up
<megachombas> 'Everything is difficult if you try to accomplish a non-trivial task in an unfamiliar environment.' definition of the fresh university system
<megachombas> french*
LocaMocha has joined #lisp
<megachombas> ive got the emacs, so parentesis aint a problem anymore
eivarv has quit [Quit: Sleep]
<rumbler31> first culprit to making things by hand in lisp is missing parens
<megachombas> this is really my last fix that i need to do
<megachombas> be able to load that asm code as lisp list without those randoms "#" added
pierpa has joined #lisp
<TMA> megachombas: if you are writing the (@ label-name) by hand, just do not use #:
<megachombas> if i remove that
<megachombas> will it still be the same
<megachombas> yep, but what about the #4= for example
smurfrobot has quit [Remote host closed the connection]
<TMA> if you do that, the |finTest7794| will be a symbol in the current package, which means (as jasom has written here already (22:32 < jasom> right, when... and following messages)) that you will probably not need the #4= (as every |finTest7794| will be read equal to other |finTest7794|) [[I am simplifying greatly, you could make it so that it will no longer true, but it would require additional effort to change it]]]
<pjb> megachombas: you can put (setf *print-circle* t) in your ~/.clisprc.lisp file.
<TMA> megachombas: how do you construct the (@ label-name) ?
<pjb> jasom: it should be: "foo"==strcpy(malloc(4),"foo")
<TMA> jasom: or strdup("foo") iirc
<megachombas> so if i remove them it will work
<megachombas> let me remove and remplace to see
<pjb> megachombas: There is no ## or #= added!
<megachombas> how not
<pjb> (first '(a b c)) #| --> a |# see, no parenthesis.
<megachombas> then the right question is
<pjb> megachombas: for example, there are absolutely no parentheses in lisp!
<megachombas> well
<pjb> megachombas: you have to distinguish the textual representation from the actual data structures.
<pjb> Similarly, there's no #= or ## in the data. Only in the representation.
<megachombas> how to transform text in parentesis form into that data structure
<pjb> ## and #= let us represent data that contains multiple references to the same objects.
<pjb> megachombas: this is done usually by READ.
<megachombas> oh
<megachombas> so if i use READ
<megachombas> that text
<megachombas> it transform it into the right structure right?
<pjb> yes.
<rumbler31> imagine replacing every instance of #1# with (LOC -1 0)
<pjb> And there are no parentheses in that structure, only cons cells and atoms.
<rumbler31> et cetera
<megachombas> lllllllllleeeeeeeeeeeeeeeeeeet me test that out
<megachombas> so if i so (read ((move r0 r1)(move r2 r3))) that will transform it into the correct list
<pjb> megachombas: now, the thing is that symbols are usually interned. Which means that when the same symbol name is read twice, the same and unique symbol is obtained. So there's no need for ## and #= when you read sexps containing multiple occurences of the same symbol: (a a a) is a list with 3 cons cells, each pointing from their car to the same symbol named "A".
<pjb> (read-from-string "((move r0 r1)(move r2 r3))") #| --> ((move r0 r1) (move r2 r3)) ; 26 |#
<pjb> Or (read) RET and then type in: ((move r0 r1)(move r2 r3)) RET
<TMA> megachombas: could you show me the piece od code that constructs the (@ #:|finTest7794|)? is it a code you have written?
<pjb> Notice that the REPL uses PRINT to do the inverse transform, from lisp data structure to textual representation, so when you read ((move r0 r1)(move r2 r3)) at the repl, it prints it, and you get back ((MOVE R0 R1) (MOVE R2 R3)) ; notice the space inserted in the normalized representation! And the uppercase, if you don't have (setf *print-case* :downcase).
<megachombas> not that i have written myself, but i have the soruce
<megachombas> a sec
<pjb> #: prevents interning the symbol, so #= ## are needed if you have several occurences of a uninterned symbol in the sexp.
<pjb> megachombas: you can use gentemp instead of gensym to generate interned temporary symbols so you don't have this problem with the textual representation.
<megachombas> i dont use gensym
<megachombas> actually, i want to get ride of the compiler and only use the VM
<megachombas> but for that, i need ASM code to put into my VM
<megachombas> going to try the read-from-string see how it goes
<pjb> in that function, there are two gensym!
<megachombas> yes, but i dont use them
<megachombas> thats compiler part
quazimodo has joined #lisp
<pjb> then write your own assembler by hand!
<pjb> Then you won't have gensyms in it!
<megachombas> i will only present VM tomorrow, as i cant even explain everything that it does, as for example i dont understant what (MOVE (LOC -1 0) (:R0)
<megachombas> but the gensym isnt a problem
<whoman> ive always felt that gensym is the wrong direction ..
<megachombas> as it just generate a symbol
<megachombas> i will just remplace by symbols written by hand
<TMA> megachombas: the compiler uses gensym. therefore the compiler result contains the result of the gensym evaluation
<megachombas> oh, isnt just plaintext?
<TMA> megachombas: if the gensym was replaced by gentemp there, the compiler result will have no #: when printed and you would have no problem with it
<pjb> megachombas: no, in lisp we never use plaintext. Instead we use lisp objects, data structures, what we call SYMBOLIC EXPRESSIONS, sexps.
<megachombas> if i remplace (@ #:|finTest7794|) by (@ hello) actually it wont work?
<TMA> megachombas: it might work.
<pjb> megachombas: when you use plaintext, you get code injection problems, and you need tons of PhD theses to find complex solutions and round abouts to avoid them. ANd you get a whole cottage industry to develop tools to test and avoid them.
<pjb> megachombas: instead, you can use 60 years old technology called lisp, which uses data structures, and therefore the problem doesn't exist in the first place.
giraffe has quit [Remote host closed the connection]
itruslove has quit [Remote host closed the connection]
<megachombas> going to give a try
<megachombas> nothing to lose anymore right now, im feeling the 1/20 coming tomorrow
<pjb> megachombas: when you use a language like C, you get buffer overflow, memory leaks etc, and you need tons of PhD theses about program verifications, sophisticated debugging tools such valgrind, and a whole cottage industry of tools and security audits to detect those problems and avoid them.
<pjb> megachombas: instead, you can use 60 years old technology called lisp, which uses a garbage collector and run-time cheks, and therefore the problem doesn't exist in the first place.
<pjb> I could go on…
<megachombas> im pretty sure lisp is strong
<pjb> No, it's weak. But it's smart.
<nirved> (defun |()| () ())
<pjb> megachombas: just to say, that it's worth learning it, to avoid all the dumb mistake the industry keeps doing over and over.
<pjb> (defun |()| (\(\)) (if (null |()|) () (|()| (cdr |()|)))) (|()| '(\(\) |()| (\(\)) |()|)) #| --> nil |#
<nirved> todays computer programs are so bloated, that the equivalent lisp machine running on the same hardware would be faster
<megachombas> https://codepaste.net/nik83k correct syntax?
<aeth> nirved: you mean LispOS, right?
<aeth> Or do you mean the equivalent lispm architecture on the same process node?
<Shinmera> nirved: Weak! Try (defun ﴾﴿()()) and (defun ​()())
<megachombas> nvm, it needs double quotes
<rumbler31> can't you just setf without read-from-string?
cgay has quit [Read error: Connection reset by peer]
<megachombas> https://codepaste.net/2pftvy like this?
<rumbler31> what happens when you execute that
<rumbler31> you tell us
whoman has quit [Read error: Connection reset by peer]
<aeth> With Lisp you can get self-documenting function names, e.g. (defun |Hello, world!| () (format t "Hello, world!~%"))
scymtym has joined #lisp
<megachombas> IT WORKS
<megachombas> YESSS
Karl_Dscc has quit [Remote host closed the connection]
whoman has joined #lisp
<Xach> cool
<megachombas> now
<megachombas> last but not least question
vlatkoB_ has quit [Remote host closed the connection]
<dim> I'm still in awe each time I write restart-case in CL
<Shinmera> restarts aren't the magic part, you can get them with exceptions too. The magic juice is handler-bind.
<dim> Shinmera: that's very true, so maybe I mean interactive 1-keystroke restart-case
<pjb> megachombas: perhaps it's too late for you, and you should go to sleep? WHen you have a function name read-from-STRING, why do you pass it a list?
Bike has quit [Ping timeout: 260 seconds]
<megachombas> it worked when i did https://codepaste.net/2pftvy
<pjb> megachombas: also we've explained that reading operations consist into transforming a TEXTUAL representation into lisp data.
<rumbler31> I think he was planning on passing it the original form with the #1= reader macros
<pjb> megachombas: so both on the count of READ and of -FROM-STRING you should give it a STRING, and not a list!
<megachombas> thats what i did, ive put the list into "" ""
<rumbler31> you could just say (setf test3 '(form...)
<pjb> Yes, in the second paste.
<megachombas> yes yes, i missed the syntax
<megachombas> i have a verrly last question for you pjb
<pjb> megachombas: but I'm trying to activate processes in your brains so you don't have to try twice before finding the right solution!
<whoman> any projects called CLoset ?
<megachombas> hold on please
<pjb> whoman: rings a bell.
<megachombas> pjb: it has been around 6 damn hours im trying to figure out what does the (move (loc -1 0) :R0)
<pjb> You mean, the function move?
fittestbits has joined #lisp
<megachombas> not the function move
<pjb> since (loc -1 0) is not a number, it's the second case that's appliede.
<megachombas> i need to know why it moves (loc -1 0 )
<megachombas> into r0
<pjb> so it computes the value of (loc -1 0) with (get-src vm src).
<pjb> which calls (get-loc-src vm expr)
<megachombas> and then
<megachombas> ye, so i go into get-src of vm (loc -1 0 )
<pjb> (if (eql (caddr expr) ()) (setf (caddr expr) 0)) cannot work in general.
<pjb> with a negative value, it reads the memory relatively to newFP.
<pjb> so basically, it refers a local variable.
<megachombas> oh GOD BLESS, LOC stands for LOCAL VARIABLE??
<pjb> No, for location, I would say.
<megachombas> oh, so its the location of local variables?
<rumbler31> doesn't your assembly have documentation?
<pjb> oh, no, you're right, it's for local variables and parameters.
<megachombas> but i dont understand what is the weird maths he does with FP
<pjb> When it's positive, it skips the return address and stack frame, to get at the parameters.
<pjb> You have to know how the functions are called?
<pjb> How the parameters are passed, and what is pushed on the stack in addition to them and the return PC.
<megachombas> well tomorow i basicly have to explain how my code works
<pjb> Usually, there's a FP link saved on the stack. You seem to have two more slots since it adds 4.
<pjb> This is probably described in the documentation/specification of the VM and/or the compiler.
<megachombas> nothing about loc on the documentation
JonSmith has quit [Remote host closed the connection]
<megachombas> so , let me see if i got it
<megachombas> if its loc
<megachombas> its going to move
<fouric> (jasom: lol what keyboard layout are you using)
zazzerino has quit [Remote host closed the connection]
<megachombas> the value of a local variable to the stack?
randomstrangerb has quit [Ping timeout: 260 seconds]
<pjb> No, to the register R0
<megachombas> oh oh
<pjb> (move (loc -1 0) :r0) means copy the local variable number 1 to the register 0.
<megachombas> and the local variable number one, where is it located in the memory
randomstrangerb has joined #lisp
<pjb> it's computed in get-loc-src
<pjb> and notice the same computation is done also in get-loc-dst, so it's redundant code!
<pjb> very bad…
<megachombas> let me see get-loc-src again
<pjb> I tought you wrote this code!?!
<pjb> You know that this channel is logged, right?
<aeth> in at least 3 places
damke_ has joined #lisp
<Shinmera> and so many places that aren't automatically public..
<pjb> Indexed by google as soon as you type a new message (or close)!
<megachombas> my idea was to rewrite the functions tomorrow morning
<megachombas> but hard to rewrite when i dont know what they do
damke has quit [Ping timeout: 264 seconds]
<pjb> Indeed, you need to read and understand them.
<megachombas> except the loc
<megachombas> yes, i understand all of them
<megachombas> as you can see, i commented everything else
<pjb> yes.
attila_lendvai has quit [Quit: Leaving.]
<pjb> My question, is why you have code that you didn't write and don't understand?
<pjb> It would be much easier to write it yourself from scratch!
<pjb> At least you'd know what it does…
<aeth> It doesn't look like particularly well-written Lisp in the first place. Unless the style got messed up in the cut and paste.
shrdlu68 has quit [Ping timeout: 264 seconds]
<aeth> It violates every style guide I know of, which makes it harder to read that it should be.
<pjb> It's possible that it wasn't in CL originally.
<aeth> Yes, it looks like it could be archaic Lisp
zagura has quit [Remote host closed the connection]
<Shinmera> I've seen enough mind boggingly awful template code from university lectures that I'm entirely ready to believe someone wrote this who just doesn't know lisp either.
sjl has quit [Ping timeout: 252 seconds]
<Shinmera> (not from my own university, but universities people I know have attended)
smurfrobot has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
<megachombas> tried to wrote my own. but at arrrived at a point where i didnt understand lisp at all. found this one that was functional, so i tried to understand it to do mine
<pjb> Not a very good way to proceed…
<megachombas> but i arrived at a point where im still trying to understand this one, and bassicly doing small modifications
<pjb> Don't you have a specification document for the VM?
<megachombas> so yes, this is pure copy pasta
<megachombas> for that vm, or of what we suposed to do?
<aeth> megachombas: If you need to pick up functional Lisp-style programming in a short amount of time, work through The Little Schemer (formerly The Little Lisper). It's in Scheme, but most of the lessons would carry over imo.
<pjb> yes.
<rumbler31> his timeline is "tomorrow"
<megachombas> ye, my timeline is tomorrow so im kinda short
<aeth> well the extreme tl;dr is that you should base it around cond
<pjb> Well, usually timelines are given three or two months in advance, so…
<megachombas> 2 months in advance
<aeth> Do not put assignments off to the last minute. I tried doing this in college, and it ruined my health, possibly permanently.
<megachombas> with 7 final examins in the middle
<aeth> There's only so much your body can handle with work in a short period of time
* |3b| just put things off until past the last minute, much better for health (bad for grades though)
<aeth> |3b|: If there are grace periods, and you're good enough to consistently be able to get an A even with the -10% penalty or whatever, it can still work
<aeth> You'll just get a low A instead of a high A
<aeth> More stressful, though
<Shinmera> I try to do things as early as possible, but then I just get stressed out to all hell towards the end anyway.
<aeth> (You'd just need the late penalty to average to -10% if you still want an A)
rumbler31 has quit [Ping timeout: 240 seconds]
<aeth> megachombas: My recommendation to you would be to pick up processing things with cond. It's fast enough that you could pick it up quickly enough. A lot of functional-style Scheme and Lisp uses that basic style. (There's no time for fancier techniques.)
<megachombas> example of cond?
<pjb> megachombas: this explains very well everything. You even have stack frame diagrams!
<megachombas> yes, just i discovered those instructions today ,and he NEVER EVER give it to us
<megachombas> retarded teacher, i dont want to be rude, but i tried my best with him
<aeth> megachombas: Well, first, does your Lisp have tail recursion?
<aeth> And if it doesn't, do you think you'd blow the stack?
<pjb> aeth: this is not the problem, there's LOOP!
<aeth> pjb: loop probably takes at least a week to learn
<pjb> not for a programmer with C, C++, Java and Python experience.
shrdlu68 has joined #lisp
<aeth> ah, okay, I missed that part
<aeth> megachombas: COND is basically an if/elseif/elseif/.../else block, except that it is a form that also returns values so you can use it just like a very elaborate ternary operator if you wanted
<dim> I think that's my favorite loop
Bike has joined #lisp
<dim> (loop repeat 10 for a = 1 then b and b = 1 then (+ a b) collect a)
<aeth> megachombas: You should make sure you understand COND first, because you're probably going to need it in your program if is going to have any elaborate conditionals in it. It's simpler than fancier alternatives.
wxie has joined #lisp
<aeth> Simple Lisp programs require understanding defun, let, if, and cond.
smurfrobot has quit [Remote host closed the connection]
<megachombas> hum
<megachombas> so the get loc actually change the frame pointer
<megachombas> but actually, it moves nothing in RO?
<aeth> I would personally try to build something useful from the very simple basics of Lisp rather than trying to dissect an existing Lisp program. Build up from a toy program and gradually add the features you need.
<aeth> It's very important, at least the way I program, to have a completely working program at every step of the way.
<megachombas> if only i had time, i would do it
<megachombas> but having the deadling tomorrow
<megachombas> kinda hard
<megachombas> but i will i deffintivly do some lisp after
<megachombas> need to learn this more in deepth
<aeth> If your teacher actually didn't explain things properly, then don't panic. If it's a large class, lots of people will probably do worse than you, and the grades might be adjusted upward.
<pjb> megachombas: no it doesn't change the frame pointer. It uses it.
ssake has quit [Ping timeout: 240 seconds]
<pjb> megachombas: you're confused, because get-newFP is procedural instead of functional.
ssake has joined #lisp
<pjb> megachombas: get-newFP uses a frame pointer index, named expr.
<pjb> (get-newFP 0) returns the current frame pointer (get vm :FP).
<pjb> (get-newFP 1) returns the frame pointer of the caller of the current function.
<pjb> (get-newFP 2) returns the frame pointer of the caller of the caller of the current function.
<pjb> etc.
<pjb> This is why there's this loop and it updates the LOCAL variable newFP. But it doesn't modify (get vm :FP) the actual frame pointer!
<aeth> megachombas: Is the assignment to build a register machine like on the website you linked to?
<pjb> It seems it is.
asarch has quit [Quit: Leaving]
moei has quit [Quit: Leaving...]
<aeth> Well, if there's more freedom of choice, then choose a stack machine. They're (afaik) simpler, especially in languages that have stacks (CL has two built-in stacks). That might not be an option, though.
<pjb> aeth: the VM is specified, since there's a compiler targetting it!
<aeth> ah, okay
<megachombas> and it must be registery machine
<megachombas> so, it saves the in the memory the position of the FP of the caller right?
<pjb> No.
<pjb> (get-loc-src vm expr) reads the memory containing the value of the local variable number EXPR in the current frame.
<aeth> megachombas: Is the assignment something like this? Given the instructions, do the operations.
orivej has quit [Ping timeout: 260 seconds]
<megachombas> the asignment is 'make a VM in lisp that use 4 registerys and a lisp compiler "
<megachombas> "you got 2 months"
wxie has quit [Remote host closed the connection]
<aeth> As in, compile a toy lisp to the VM?
damke has joined #lisp
cgay has joined #lisp
juan-reynoso has joined #lisp
juan-reynoso has quit [Client Quit]
damke_ has quit [Ping timeout: 264 seconds]
<megachombas> what do you mean by toy?
wigust- has joined #lisp
<aeth> I mean a trivial Lisp-like language, not an actual usable language.
<aeth> (And if your requirement is to compile a standard Lisp or Scheme, then you're doomed.)
<megachombas> yes yes, just some of the language
<megachombas> like defun, setf, etc
wigust has quit [Ping timeout: 240 seconds]
nirved has quit [Quit: Leaving]
<whoman> well
smasta has joined #lisp
<aeth> I'm not sure any Lisp resources will be helpful. The assignment itself, even to those who know Lisp, will probably take more than one day to write.
<aeth> I'd estimate 3 days.