freenode/#lisp - IRC Chatlog
Search
20:30:49
knobo
Arrays are great. But it would be grater if delete would also set the deleted positions to nil or 0 or something approperiate, so that data could be garbage collected
20:32:11
knobo
And it would be greater with certainty that adjustable-array-p would be the same after delete.
20:54:12
knobo
So the more I think about arrays vs lists I think I'll go for lists as default then rather use array if I can justify that.
22:31:13
tetero
Quick (and likely stupid) question: What's the difference between (in-package :something) and (in-package something)?
22:35:45
|3b|
where the symbol is interned (which in practice probably means "not much" unless you modify packages at runtime, with for example IMPORT)
22:37:19
tetero
I was wondering because they seem to have the same result for me, in what I'm doing, (not doing what you're describing), but I figured that in Common Lisp it's there for a reason
22:38:10
|3b|
other options are (in-package #:something) which doesn't intern at all, and (in-package "SOMETHING") which also doesn't intern, but may get confused when people run with non-default readtable case (and/or 'modern mode' lisps)
22:38:49
|3b|
IN-PACKAGE is a macro, and the package name isn't evaluated, which is why you don't need to quote the non-keyword symbols
22:39:55
|3b|
the package name is a "string designator", which means it can be a string, character (representing a string containing that character), or a symbol (representing the string naming the symbol)
22:40:55
|3b|
symbols in CL are converted to uppercase by default, so :something, something, and #:something are all symbols named "SOMETHING", so when used as a string designator all designate the same string "SOMETHING"
22:42:40
|3b|
"designators" are mostly in CL just for convenience, since in most cases you could use a string directly or convert it explicitly.
22:43:51
|3b|
the various syntax for symbols (keywords, normal symbols and uninterned symbols) are there for reasons, but those reasons mostly unrelated to use of symbols as designators
22:45:20
tetero
Aye. My spontaneous reaction when dealing with Common Lisp is that things are thought through and aren't arbitrary
22:45:21
|3b|
if you only use defpackage, and never IMPORT, USE-PACKAGE, etc to modify existing packages, you usually won't notice the problems caused by interning extra symbols
22:45:57
|3b|
(aside from possibly seeing a few extra options when you try to complete symbol names in slime)
22:48:45
|3b|
if you IMPORT a symbol into a package, and that package already has a symbol by that name, you will get a conflict. Similarly when using USE-PACKAGE, you will get conflicts if any of the symbols in the used package already exist in the other package
22:51:43
|3b|
and a less serious problem (if at all), is that INTERNing the symbol prevents it from being GCd, so using :foo or foo instead of #:foo potentially wastes a few bytes
0:17:20
krwq
is there some good example how to use ironclad with aes in cbc mode? i tried simply doing encrypt-in-place and when i pass a plaintext which is shorter than one block it doesn't do anything which suggests that it does something else what i thought it does
0:21:39
krwq
i took my current example from http://gihnius.net/2014/09/68-secure-your-cookies-of-hunchentoot-in-common-lisp/ but this is simply wrong
1:58:17
jasom
krwq: I haven't inspected it for correctness, but https://github.com/Shinmera/crypto-shortcuts wraps ironclad with easier-to-use functions
2:24:55
Bike
you can treat numbers (actually integers) _sort of like_ vectors, but they're not actually vectors, in lisp terms
2:27:23
krwq
ok, i would forget about negative, they have conventions for bits, but non-negative should be interchangable with bit vectors imo
2:43:46
Bike
well one chapter is called "numbers, characters, and strings" so there's three right there
2:55:01
Bike
okay, okay, what? "some random name from a class"? "some random places"? do you have some concreate examples of what's confusing you, maybe?
3:02:09
Bike
there's no limit on N for (unsigned-byte N), for instance. (I mean, you'll run out of memory at some point)
3:03:51
|3b|
ACTION was about to paste http://www.lispworks.com/documentation/HyperSpec/Body/04_bc.htm
3:04:50
|3b|
4-3 is the list of ones that can have parameters, 4-4 is ones that have to have parameters
3:13:25
|3b|
http://www.lispworks.com/documentation/HyperSpec/Body/04_cg.htm#classtypecorrespondence 4-8 has a list of types that are also classes
6:54:09
elderK
Hey guys, I recently felt like tinkering with Lisp again and did some reading of the CLHS.
6:54:37
elderK
The specs say that it's up to the implementation whether a slot accessor is setfable?
7:04:41
elderK
dmh: I get the feeling this CLHS page was rushed or is kinda... wrong. If you follow the syntax spec for defstruct, you'd think they you can only specify a *single* option for slots.
7:06:21
elderK
dmh: I'm not even sure how you'd go about implementing a setf for defstruct. I mean, structures are different from objects, right? They're not just some "cut down" version of CLOS classes?
7:08:12
dmh
installing something from planet and finishing a project in a day and then not touching either for a month :-)
7:10:29
elderK
Which, of course, complicates things a fair bit if you want to make your RT things reasonably efficient.
7:12:46
elderK
(I figured I'm make a minimal binding for SDL2 and make a simple 2D 'game' where you just move yer dude around the screen. Nothing complex.)
7:13:44
elderK
CFFI seems pretty nice - I played with it a couple years back, the groveller and stuff.
7:13:55
dmh
i was causing something to greatly fuck up and couldnt figure itout. lost those sources to a like 10 year old SSD pooping out
7:14:56
elderK
I've lost track of how much time I spent creating my own implementation of records and objects and stuff in Scheme.
7:15:43
elderK
Years and years ago, I was scheming in a big way - reading tons of whitepapers and stuff. But, whenever I tried to do something *real*, like say, write a program to analyze ELF binaries, I just... found it very painful.
7:18:11
elderK
I used to play with Racket back when it was called PLT Scheme. I never really liked it much - sure, it had Planet and stuff but... I don't know, it didn't feel like Scheme.
7:18:28
elderK
So I migrated to Chicken pretty fast. The fantastic community of #chicken kept me using it :)
7:20:38
elderK
It's sad, really. Like, at my last job, I would tell interested friends about CL, Scheme, Standard ML, etc.
7:22:07
elderK
It's kind of depressing, tbh. I used to believe you needed to be *great* at programming and stuff to get a job.
7:22:45
elderK
The majority of programmers at the company - who possessed degrees - didn't even remember when they should use what data structures, everything was just a linked list.
7:28:00
elderK
I.e. You complete some project, written nicely, maintainable, extensible. You're done well before the deadline.
7:43:00
elderK
I WOULD read some existing libraries for this - but, it's... like... You don't want to jump into the deep end straight away, you know?