freenode/lisp - IRC Chatlog
Search
4:58:34
nyef
Bike: I might have said that. I certainly said that it was a pile of hacks that nobody has ever understood completely.
5:00:14
beach
Bike: All of the code in CODE-UTILITIES need to be rewritten, or rather, a new library (say CST-UTILITIES) needs to be created. The big part is the implementation-independent lambda-list parser.
5:01:15
beach
Bike: Right now, the result of the lambda-list parser is a standard instance with a slot for each kind of parameter, but that won't do, because an implementation may introduce new lambda-list keywords, and their position in the lambda list may be important.
5:02:50
beach
So we need a lambda-list parser that preserves the order, presumably as a list of standard instances. And we need some parsing technology, probably Earley or combinator parsing so that client code can add new rules in a modular way.
5:05:24
beach
Anyway, a complete set of CST utilities would be very useful for other things as well, so it may be worth the effort.
5:10:21
borei
i have 2 types of objects - Vector and Matrix - they are linear algebra object(s) with defined math on the them - like sum and mulitply by number, components can be different - double, int, complex
5:12:02
borei
my question would be - i exported "+" operator from both packages, how lisp will know what one to use
5:13:02
beach
borei: You would have a generic function named (say) + and then each package would define methods on it specialized to its own classes.
5:13:51
beach
borei: That way, client code would just use + and the generic dispatch of your Common Lisp system would figure out what method to apply.
5:16:42
beach
borei: Not directly, no. Clasp uses Cleavir for its compiler and I am the author of Cleavir. Bike works both on Clasp and on Cleavir.
5:19:01
borei
i remember i saw your nickname in commiters, maybe different person, i was inspired by drmeister to look towards lisp
5:20:40
beach
I see. I don't think I have committed anything to Clasp. Congratulations to discovering Common Lisp!
5:23:36
borei
thanks ! seems like it's gonna be very steep learning curve, not sure if my approach is correct or not. currently im trying to build some analogy with traditional languages like C/C++, Tcl, but that approach can start to play significant drawback later, because lisp feature will not be absorbed.
5:27:07
axion
Does it make sense to define different ftype declarations for primary methods or is it even possible?
5:42:25
edgar-rft
the funny thing is that Lisp already had a tradition when C etc didn't ebven exist
5:54:21
beach
ACTION is thinking about how to define concrete syntax trees (CSTs) so that they are useful both for source tracking in the Cleavir compiler and for incremental analysis of Common Lisp code in Second Climacs.
5:56:44
beach
Unknown reader macros can do arbitrary things, like adding an expression that was not read, removing an expression that was read, or changing the order between sub-expressions that were read.
6:02:55
borei
find good explanation to my question and generic function - https://en.wikipedia.org/wiki/Generic_function
6:05:02
borei
loke: agree, syntax is ... different, but logic - is ok. my concerns is - not to miss LISP features which are not available in other languages. for now i have zero knowledge about such features.
6:06:08
loke
You can start by writing code in a style that is familiar to you, and then you will find yourself using more and more Lisp-specific stuff.
6:06:18
aeth
borei: The only Lisp feature you're not going to see done well in some other language is macros. If a language does macros Lisp- style on s-expressions, it's probably a cousin of Lisp.
6:06:46
aeth
What makes Common Lisp special is that it has quite a lot of different paradigms in one language, and because of the syntax, they don't seem out of place.
6:06:50
loke
Now, the most important benefit of Lisp isn't really the language per se,e but rather the way in which you develop. The way in which you write code and recompile functions in a running program. All of that is much more important tan language features you can learn later.
6:09:01
aeth
Some languages have workaround hacks for hotloading stuff, but in Lisp that's the norm.
6:10:23
borei
it's hidden from me for now, need to get momentum. i have program (not completed) which is mix of C/C++ and Tcl and now im converting it to C/C++ and Lisp, so learning on the fly.
6:10:56
aeth
Imo, the best way to learn imo is to just write and write and write, and revise older code to be more idiomatic Lisp later.
6:11:43
aeth
It's a large language, but every time you learn something new, you can see if there's something in a previous program that you can rewrite to be better. But first there needs to be previous programs.
6:12:45
aeth
Just write lots of tiny functions that, if you can get away with it easily, return values rather than set things.
6:13:34
aeth
Few functions are too small. If you're concerned about the performance of having an extremely tiny arithmetic function add: (declaim (inline foo)) right above the line (defun foo ()
6:13:59
aeth
But only inline tiny functions, and if you're not sure disassemble to make sure they're actually tiny!
6:40:59
beach
I think I have an idea for a separate library for Concrete Syntax Trees (CSTs). I'll create a repository and write some code and some documentation.
11:05:42
dxtr
So what's the common thing to do in multi-file projects? Are all files their own package or the same?
11:08:31
jackdaniel
some prefere file-per-package, others have a separate packages file and source scattered trough many files
11:08:59
jackdaniel
sometimes it's just one package for whole system, or two packages (interface, and internal implementation)
12:38:49
phoe
I've somehow installed OpenJDK7 on FreeBSD on SPARC and managed to run ABCL on it. Installing Quicklisp fails though and all I get is, debugger entered on ERROR: "Invalid argument".
13:41:50
dxtr
jackdaniel: If I were to use one package per file (or directory for that matter) would it make more sense to define the package in package.lisp or the file itself?
14:15:32
dxtr
So if I were to create a macro that creates some variables with DEFPARAMETER with names based on the input; would I have to concatenate the variable names as strings and then convert them to symbols and then pass that to DEFPARAMETER?
14:24:28
dxtr
I actually found a stackoverflow question that was close to what I wanted to do :D http://stackoverflow.com/questions/22359035/define-variable-with-defparameter-with-name-determined-at-runtime
14:25:15
dxtr
like if I want it to do three defparameter I just do `(defparameter ....)\n`(defparameter ...)?
15:13:29
afidegnum
hi, i m reading some gigamonkey tutorial but i don't understand this part.... https://ghostbin.com/paste/v355s which among them is responsible for the prompt ?
15:14:31
drmeister
Does this look right? In the cl-jupyter project there is an UNWIND-PROTECT that looks like it has a typo where the form that should be in the protected-form ends up in a cleanup-form
15:16:14
beach
afidegnum: The call to FORMAT is responsible for the prompt, and the call to FORCE-OUTPUT makes sure that all buffered output is transmitted to the device.
15:17:44
nyef
drmeister: But the nature of the failure is such that a casual test wouldn't find a problem, since it's basically "just" the cleanup code not getting called.
15:18:20
nyef
And that, only with a non-local exit. If SHELL-LOOP exits cleanly then there's nothing to see.
15:19:37
beach
afidegnum: It generates some output that the user sees. That's what we call a prompt.
15:20:33
beach
afidegnum: Some other function calls the function prompt-read to print the prompt and read a line of input typed by the user.
15:22:05
afidegnum
so if i understand, force-output will emit the prompt and read-line will capture what the user typed, right ?
15:22:56
beach
afidegnum: No, the FORMAT will emit the prompt, either to the device or to a buffer. FORCE-OUTPUT will make sure that, if the prompt was emitted to a buffer, then the buffer is transmitted to the device.
15:25:32
afidegnum
ok, i think i will read more about it, Ah, earlier i read (fornat t "") where t is part of the destination, we do have string and streams
15:26:45
beach
afidegnum: For FORMAT, the first argument designates a stream. For FORMAT it can either be a stream or T or NIL. T means the same as the stream *standard-output* and NIL means that the result is returned as a string.
15:38:19
afidegnum
beach: i know there is a read function which prompt a user but i don't understand how come FORMAT too play a role as a prompt
15:40:00
beach
afidegnum: By "prompting the user" I mean show some kind of message, such as "Pleas user, enter a file name, would you:"
15:40:58
beach
It is the PRINT functions (and in this case the formatted output function FORMAT) that can print such messages.
15:45:50
beach
I don't see any function under "Output functions" that says it prompts. Which one do you see?