freenode/lisp - IRC Chatlog
Search
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?
16:58:39
learning
hi, i'm trying to find a toy example for (format t "~:@c" #\magic-character) where #\magic-character shows unusual shift keys so that I can better understand the c directive. i know its imlementation dependent. have sbcl and clisp already setup.
16:58:59
learning
page that im referencing: http://www.lispworks.com/documentation/HyperSpec/Body/22_caa.htm
17:03:44
nyef
Problem is, it basically needs both the "implementation-defined attributes" and full knowledge of the input device mapping, neither of which are things that a modern Lisp system tends to have.
17:30:06
afidegnum
lispworks and allegro, don't they have a free license? or everything is paid? and after the trial version of what they offered you can't use their product again?