<aeth>
asdf_asdf_asdf: it is easy! two things. First, if you only care about a positive number, you only have to look at rotate-tail-to-head. Second, if you only care about lists, you only have to look at the first branch in rotate-tail-to-head, which are lines 31-37
fsmunoz has quit [Ping timeout: 276 seconds]
<asdf_asdf_asdf>
Not today, sorry.
<aeth>
oh, and it has a proper-list-length, but you can probably just replace that with length since you don't care about as many edge cases as alexandria...
<asdf_asdf_asdf>
OK, thanks for all.
<asdf_asdf_asdf>
Bye.
<aeth>
bye
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
dreamcompiler has quit [Ping timeout: 240 seconds]
<remexre>
Is there something already existing for printing objects with a subset of their slots?
<remexre>
Like say I have (defclass foo () (bar baz)) (define-print-object foo (bar))
<remexre>
this'd print a foo with a bar slot of 1 as #<FOO :BAR 1> or something, with pretty-printing and all that jazz
<dlowe>
you define a print-object method specializing on your class
<dlowe>
(defmethod print-object ((object foo) stream) (format stream "this is my foo object: ~a" foo))
<dlowe>
there is also a print-unreadable-object macro for easily producing a print-object output in a standardized manner
<aeth>
dlowe: uh, two issues with that first method: one you said foo instead of object in the print... and two you mae a recursive print that made my SBCL unhappy
orivej has quit [Ping timeout: 240 seconds]
<aeth>
you probably just wanted this (defmethod print-object ((object foo) stream) (format stream "this is my foo object")) ; test with (make-instance 'foo)
dddddd has quit [Remote host closed the connection]
<aeth>
you probably always want "print-unreadable-object" like this: (defmethod print-object ((object foo) stream) (print-unreadable-object (object stream :type t :identity t)))
<aeth>
that gets a #<FOO {100301FCB3}>
<aeth>
you can drop the latter and just get #<FOO > if you don't have :identity t
<dlowe>
you know, I think I made that recursive print mistake the first time I made a print-object method too
<aeth>
(defmethod print-object ((object foo) stream) (print-unreadable-object (object stream :type t) (format stream "~A" 42))) ; pretend 42 is an accessor on foo, it isn't here so you can test it with (defclass foo () ()) and (make-instance 'foo)
<aeth>
remexre: this last one is what you probably almost always want ^
<remexre>
er yyeah I know about that machineryyy
<aeth>
if it's too verbose you can write a macro that hides all of that except for the "~A" 42 part and maybe optionally :identity t
<remexre>
ugh, sorry, new keyboard is multi-pressing
<remexre>
I'm trying to abstract that all down to (define-print-object CLASS-NAME (&rest SLOTS))
<remexre>
b/c the above doesn't, for example, do anything with the pretty-printer
<aeth>
remexre: if you *just* want to get it down to the slots, then you can abstract it a bit more, for instance, generate a FORMAT for every object in body (easier than generating a more advanced FORMAT string)
<remexre>
the body's what I want to generate though (largely because I don't wanna have to internalize the pretty printer)
<aeth>
remexre: right, so then process body to generate a (format stream "~A" ,foo) for every foo in body, and do a bit more additional processing if you don't want to have to do a slot access or accessor call in the body, either
<aeth>
then it'd wind up looking like (define-print-object foo () a b c) ; for slots or accessors a b and c, depending on which way you go
<remexre>
the "a bit more processing" seems non-trivial when pretty printing and such get involved
<remexre>
or at a minimum, I can't figure out how to get the pretty-printer to do what I want :P
fragamus has joined #lisp
fragamus has quit [Ping timeout: 245 seconds]
<aeth>
remexre: oh, right, you want the name of the slot as well as the slot contents
<aeth>
remexre: personally I'd do it manually with the version that I provided, if I even wrote a macro. something like this: (define-print-object foo () "~A ~A ~A ~A" :foobar (foobar foo) :quux (quux foo)) ; modify the macro to say (,class ,class) instead of (object ,class) so you can do this
<aeth>
That then should say #<FOO :FOOBAR whatever :QUUX whatever> or #<foo :foobar whatever :quux whatever> depending on your *print-case*
<aeth>
and I think the ~A means it will br printed as you expect.
<remexre>
huh, okay, I'll try that
<aeth>
If FORMAT doesn't do what you want, you're going to have to play with other print/write functions on the stream stream
<remexre>
yeah, it looks like it's not doing things ideally
<remexre>
my test being
<remexre>
(let ((big (loop for i upto 20 collect i))) (print-unreadable-object ((make-instance 'foo) *standard-output* :type t) (format t "~s ~a ~s ~a" :bar big :baz big)))
<remexre>
prints the :bar one one line, then :baz miserly
<remexre>
rather than each of bar and baz on their own line
<edgar-rft>
akoana: the particular problem with my (read-from-string ...) hack is that it makes it too easy to inject malicious code into a running Lisp program. It's always better to check user data from the outside world via parse-integer or some other appropriate way first.
<aeth>
akoana, edgar-rft: And *read-eval* isn't the only issue so it's best to use a library that is a known-safe read
<aeth>
so, really, only the higher order function version is good
notzmv has joined #lisp
t58 has quit [Quit: Leaving]
sjl has quit [Quit: WeeChat 2.2-dev]
<aeth>
remexre: Well, ~% will get you a newline but it still might not quite give you want you want. You might be able to solve it in one format string but it's like regex... you might not be able to read the line when you're done.
<aeth>
Personally, I'd start writing a bunch of read/print/format all targeting one stream
<remexre>
yeah, I'm doing this in the process of throwing away a format string I don't remember writing (committed at 5AM, sooooo) that's mostly punctuation
<remexre>
and ideally instead having loads of write, pprint-indent, pprint-newline, etc. calls
<aeth>
well, I've never really messed with the pprint stuff, I mostly just mix write-foo and format
<akoana>
edgar-rft, aeth: thanks
<aeth>
(and terpri)
<remexre>
yeah, I'm getting dangerously close to the point where I write my own implementation of the paper I linked above :P
<remexre>
I guess I'll reread the XP paper as a "last chance" while I get dinner...
libertyprime has joined #lisp
semz has quit [Ping timeout: 245 seconds]
nowhereman has quit [Read error: Connection reset by peer]
abhixec has quit [Quit: leaving]
lxbarbosa has quit [Remote host closed the connection]
lxbarbosa has joined #lisp
EvW has quit [Ping timeout: 245 seconds]
semz has joined #lisp
semz has joined #lisp
semz has quit [Changing host]
xkapastel has quit [Quit: Connection closed for inactivity]
nowhereman has joined #lisp
emacsomancer has joined #lisp
nowhereman has quit [Remote host closed the connection]
_whitelogger has joined #lisp
<remexre>
ok, I think XP can't do what I want, time to create cl-wadler-pprint...
Nomenclatura has joined #lisp
sellout-1 has joined #lisp
sellout- has quit [Ping timeout: 268 seconds]
<White_Flame>
duckduckgo always seems to find clhs.lisp.se instead of lispworks.com when searching for clhs nowadays. I wonder why that is
<vms14>
it's simple stuff, it just computes the resistor color bands
Nomenclatura has quit [Quit: q]
<vms14>
but I see a lot of repetition, like with the first and second bands
<no-defun-allowed>
You could fix the indentation and move the ecases to alists or some other associative structure.
<vms14>
the indentation was fucked somehow, but in emacs looks nice
<White_Flame>
it contains tabs, that's why
<no-defun-allowed>
You should make sure Emacs doesn't put out tabs, since text viewers tend to disagree on what size they are.
<White_Flame>
if you drag-select on the paste page, you can see that it's tabs
<vms14>
Iguess it's because I've changed stuff
<no-defun-allowed>
(coerce <number> 'float) is better written as (float <number>) and you don't have to write FIRST as FST because CL is a Lisp-2 and names won't be shadowed like that.
lxbarbos` has joined #lisp
<vms14>
yeah, I know about lisp2 namespaces, but I'd like to not get used to doing that
<no-defun-allowed>
(+ (* first 10) second) is probably an easier to read way of putting the bands together at the end, too.
<White_Flame>
since the first & second reusde the exact same lookup, you should defer that ot a function
<vms14>
oh lol
<vms14>
thanks
<aeth>
no-defun-allowed: FLOAT isn't as simple as it looks because of its quirks.
<vms14>
I'll change the coerce stuff and the repetition of second
<aeth>
without a second argument it returns either the number itself if it's already a float, or the number as a single-float. So (float 1d0) is 1.0d0 but (float 1) is 1.0f0
analogue has joined #lisp
lxbarbosa has quit [Ping timeout: 276 seconds]
<aeth>
If you're using float imo you want to know what type of float you want (single or double) and provide a "prototype" as 1f0 or 1d0 (or if your lisp supports it, 1s0 or 1l0 as well)
<aeth>
otherwise which kind of float you get depends on the unknown input
<vms14>
aeth: then is better to just let it with coerce?
<vms14>
the only reason I'm using coerce is because I don't want a fraction representation
<vms14>
and didn't know how to avoid that unless I put 0.0
<aeth>
vms14: well, (coerce foo 'float) will always be single-float if it's not already a float, making it identical to FLOAT's behavior with no arguments afaik
<vms14>
then just float, didn't know the float function exists
<vms14>
xD
<aeth>
Well, I tend to use (coerce foo 'specific-float) or a function that wraps that to make it shorter because using 1f0, 1d0, etc., to specify the type looks ugly even though the compiler uses the same thing to implement it
<aeth>
but if you're doing (coerce foo 'float) then that behavior is identical to (float foo) so FLOAT might be better
<aeth>
vms14: as for "I'd like to not get used to doing that", the thing is, you should write idiomatic code where possible in the language that you're writing imo
<no-defun-allowed>
Should I name the accessor for the slot %FOO %class-foo or class-%foo?
<vms14>
aeth: isn't bad practice?
<vms14>
well you're right
<aeth>
it's idiomatic in CL to have a foo stored in the variable foo of type foo created with the function foo... because if that feature's there why not use it?
<vms14>
it just makes more sense to name it first instead of fst
<aeth>
as for your style, I'd personally use keywords rather than symbols in your ecases
<aeth>
I'd also personally define member types for those cases so it's a type error before the ecase happens. I'd leave that as ecase. The compiler should optimize the else error part.
<vms14>
you mean (:black 0) etc?
<aeth>
yes
tourjin has quit [Ping timeout: 245 seconds]
<vms14>
I've tried and had an error
<aeth>
and it's just more obvious what the issue is if it's a type error instead of an ecase error
<vms14>
which I don't understand since I did that with keywords in a case
<aeth>
I'm not sure how you could have gotten an error
<vms14>
naybe was for other reason
<vms14>
yeah, it works fine with keywords, so nvm
<aeth>
vms14: what you could do is you could write a macro to define a member type and a trivial ecase function for each of your entries.
<aeth>
maybe something like (define-member-with-ecase (type-name function-name) :foo 0 :bar 1 :baz 2 :quux 3) which then expands to something like `(progn (deftype ,type-name () '(member :foo :bar :baz :quux)) (defun ,function-name (,your-gensym-here) (check-type ,your-gensym-here ,type-name) (ecase ,your-gensym-here (:foo 0) (:bar 1) (:baz 2) (:quux 3))))
<aeth>
you could also use declare instead of checktype there
<aeth>
Then you have a bunch of top-level defines for each of those long lists and you've effectively created pseudo-enums out of MEMBER types with ECASE
<aeth>
I personally love very high level top-level DEFINE-FOOs
<vms14>
I was looking for enum in common lisp
<vms14>
and found an answer in stackoverflow suggesting deftype
fragamus has joined #lisp
jao has quit [Ping timeout: 268 seconds]
<vms14>
but I don't understand what it's doing
libertyprime has quit [Ping timeout: 245 seconds]
<vms14>
so I'll look at deftype later and learn why can act as enum
<vms14>
I've changed the coerce for float, and symbols for keywords in the ecases
<vms14>
thanks for your hints guys
<vms14>
I've also changed read-from-string for * fst 10
<vms14>
now I should change fst for first
<vms14>
done
<vms14>
ty guys
<aeth>
vms14: a member type just goes through the list and tests to see if it's eq (iirc) to a member of the list
<vms14>
what I wanted to change was the 2 ecases for one
<vms14>
but I'll let it for later
<aeth>
vms14: a '(member :foo :bar :baz :quux) probably compares the variable to all four to see if it's EQ and if not there's a type error
fragamus has quit [Ping timeout: 276 seconds]
<aeth>
so all it's doing is documenting the type that implicitly exists in the ecase
<aeth>
You don't need it, if I was writing the macro I suggested, I would start with just generating the case, and later add the deftype
<aeth>
It's best to grow a macro piece by piece
<vms14>
thanks for the clarification, now I get what's doing
<aeth>
vms14: usually just the member type is good enough, it's only requiring a macro because you want an actual enum (i.e. some known integer associated with the symbol), not just the emulated enum via member types
<vms14>
I guess I'll end writing some enum macro
<vms14>
this is the best of lisp, if it's missing something, you just create it
<aeth>
right
<vms14>
and you have a lot of tools to create stuff
<vms14>
manipulate lists*
<aeth>
(define-member-with-ecase (type-name function-name) :foo 0 :bar 1 :baz 2 :quux 3) or define-enum or whatever you call it is fairly simple conceptually. You have a plist body, you iterate it manually or with e.g. alexandria's plist iteration macro, and then you process it twice. Once just takes the keywords, for the member type, and the other generates the ecase "enum" function that returns the enum integer for the symbol
<aeth>
so it doesn't take much to have real(ish) enums even though they don't exist, at least not enumerated
<aeth>
You could even get fancier with the syntax if an explicit call to an enum function isn't purist enough of an enum for you, but... that's probably pushing it.
<aeth>
And this isn't even the only way to do it. Another (perhaps more direct) way just defines a bunch of constants. That's probably the other common one.
<vms14>
for a simple enum without letting you change the order, I guess a simple list could work
<aeth>
well, a list in the macro
<vms14>
by looking at the position of the matching symbol
<aeth>
You could just have something that does e.g. a symbol-macrolet or something and gives you a locally scoped enum.
<aeth>
But I think the member type + function is the Lispiest, probably
vaporatorius has quit [Read error: Connection reset by peer]
fragamus has joined #lisp
<vms14>
((lambda (x) (1+ (position x '(one two three)))) 'one)
saravia has joined #lisp
<vms14>
seems will work for simple enums
libertyprime has joined #lisp
fragamus has quit [Ping timeout: 240 seconds]
fragamus has joined #lisp
<beach>
Good morning everyone!
<vms14>
hi beach
<aeth>
vms14: well, it deppends on if you wanted to control the number or just have a number
<vms14>
yes, for (one two three six = 6) won't work
<vms14>
well the macro could look for that, but then maybe better to just use deftype
<aeth>
with ":foo 0 :bar 1 :baz 2 :quux 3" I'm assuming you want to control the number on each because otherwise that breaks the plist assumption unless you have some default ignore-me symbol like _ or you use alists
fragamus has quit [Ping timeout: 245 seconds]
<aeth>
if you just want a number, ":foo :bar :baz :quux" is simpler, but if you want it to be optionally defined, it gets complicated. Probably best to make it ":foo :bar (:baz 42) :quux" in that case
fragamus has joined #lisp
<vms14>
:foo :bar (:baz 42) :quux seems better
<vms14>
and you could even define a starting number
<aeth>
that syntax is better if you're not going to define it for most cases, plist syntax is better if you're going to define it in all cases
<aeth>
You can use loop at macro expansion time to generate the numbers that aren't provided (skipping over any that are already provided, which is the one complication there)
<vms14>
I'm not able to write macros yet
<vms14>
just little ones
<aeth>
Don't write macros, just write functions that take in lists and return lists.
<vms14>
xD
<aeth>
Then put those functions in separate files, or in eval-when and you get a trivial one-line macro
<aeth>
the only complication is gensym, which you can use alexandria for
<vms14>
I need to practice with macros, the macros I write suck
<vms14>
and no lisper is a lisper if does not know how to write macros
<vms14>
in the same sense no perl programmer is a perl programmer if does not know to use regexp
<vms14>
c programmer with pointers, etc
analogue has quit [Quit: Leaving]
<aeth>
Well, you always use macros, but rarely write them.
karlosz has joined #lisp
vms14 has quit [Remote host closed the connection]
<beach>
minion: memo for vms14: You should not mix quantities and units like that. Use the quantities everywhere: resistance, tension, current.
<minion>
Remembered. I'll tell vms14 when he/she/it next speaks.
<beach>
Americans are particularly sloppy in that respect. Not only do they use "voltage" when they mean "tension", but they also use things like "mileage" and "footage". It is really dumb, because several quantities can use the same unit.
nanoz has joined #lisp
<beach>
You don't say "what is your inchage?". You say "What is your height?" or "How tall are you?". And you don't say "what is your poundage?" (which in the UK would be "what is your stonage?"). You say "What is your weight?".
lxbarbos` has quit [Ping timeout: 246 seconds]
lxbarbos` has joined #lisp
lxbarbos` has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #lisp
fragamus has quit [Ping timeout: 240 seconds]
nostoi has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
saravia has quit [Remote host closed the connection]
abhixec has joined #lisp
shangul has joined #lisp
lxbarbosa has joined #lisp
<remexre>
is there an implementation-independent version of stream-output-width?
<remexre>
or rather, a trivial- package providing it
isBEKaml has joined #lisp
abhixec has quit [Quit: leaving]
gravicappa has joined #lisp
nostoi has quit [Quit: Verlassend.]
q9929t has joined #lisp
q9929t has quit [Client Quit]
tourjin has joined #lisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Lord_of_Life has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
tourjin has quit [Quit: Leaving]
tourjin has joined #lisp
moldybits has quit [Quit: WeeChat 2.4]
nanoz has quit [Ping timeout: 240 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
vaporatorius has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<tourjin>
if i opend split window with C-x 3 , and M-x tetris on left window. after I opened a file on left window. what am i supposed to do with tetris? how can I remove tetris? if I close the file, I see tetris again. I mean I like to remove tetris from current emacs memory. how can I unload modules I loaded?
shangul has quit [Remote host closed the connection]
shangul has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
<tourjin>
when I shutdown emacs can I just C-x C-c even if i loaded lots of modules?
lavaflow has joined #lisp
michalisko has quit [Ping timeout: 245 seconds]
Remavas has quit [Ping timeout: 245 seconds]
isoraqathedh has quit [Quit: No Ping reply in 180 seconds.]
FreeBirdLjj has quit [Ping timeout: 245 seconds]
michalisko has joined #lisp
Remavas has joined #lisp
isoraqathedh has joined #lisp
isBEKaml has quit [Quit: leaving]
moldybits has joined #lisp
retropikzel has joined #lisp
libertyprime has quit [Ping timeout: 245 seconds]
atomik has quit [Ping timeout: 276 seconds]
vlatkoB has joined #lisp
Bike has quit [Quit: Lost terminal]
atomik has joined #lisp
FreeBirdLjj has joined #lisp
karswell has quit [Read error: Connection reset by peer]
<ck_>
tourjin: did you go through the emacs tutorial?
<tourjin>
i'm reading .
<ck_>
C-c C-k 'kills' a buffer; C-x C-b displays a list of buffers you can navigate through, pressing 'k' on them marks those for removal, 'x' applies the changes.
<ck_>
these are pretty fundamental and I'd advise you to please go through the manual before asking those kinds of questions; there's also #emacs
<pjb>
ck_: C-x k
<ck_>
pjb: exercise for the reader
<tourjin>
thank you. it was hard to find proper keyword.
FreeBirdLjj has quit [Ping timeout: 240 seconds]
karswell has joined #lisp
<ck_>
tourjin: C-h t gives you the tutorial. work through that one. But as you noticed by my mistaking C-c C-k for C-x k, after a while there's not really those letters on your mind anymore, your fingers just press the buttons
eSVG has joined #lisp
libertyprime has joined #lisp
igemnace has joined #lisp
retropikzel has quit [Ping timeout: 245 seconds]
retropikzel has joined #lisp
<White_Flame>
does the standard RANDOM functionality allow seeding the random state in a way that is reliably repeatable?
<White_Flame>
ie, in most other languages you can give it an integer
<no-defun-allowed>
I don't think the nature of the random number generator is specified in CL, so there can't be a number that maps to a random state.
ggole has joined #lisp
<White_Flame>
yeah, it seems that the only thing you can do is grab the current, or make a new fully randomized one
<White_Flame>
but I'd like to seed it in some way that, regardless of restarting the image from scratch, it can generate a repeatable sequence
<no-defun-allowed>
At least on SBCL, CCL and CLISP, you can print the random state readably though.
<White_Flame>
yeah, and it is pretty large
<White_Flame>
and not easily seedable from a single int
<White_Flame>
(making a another-language-in-CL, where that language wants an int-seedable PRNG)
froggey has quit [Ping timeout: 276 seconds]
froggey has joined #lisp
raghavgururajan has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
<Shinmera>
White_Flame: you can't do that portably, and that's the primary reason I started writing some RNGs myself.
<White_Flame>
yep. do you have some posted anywhere?
<Shinmera>
They're not "high performance" though so they might not suit you rneeds.
<White_Flame>
I don't think I need to care about that
_whitelogger has joined #lisp
tourjin has quit [Ping timeout: 268 seconds]
Blukunfando has quit [Ping timeout: 265 seconds]
vlatkoB has quit [Ping timeout: 276 seconds]
emacsomancer has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #lisp
Lord_of_Life has joined #lisp
libertyprime has quit [Ping timeout: 276 seconds]
rippa has joined #lisp
nanoz has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
jonatack has quit [Quit: jonatack]
gravicappa has quit [Ping timeout: 240 seconds]
gravicappa has joined #lisp
jonatack has joined #lisp
jonatack has quit [Client Quit]
<jackdaniel>
ecl has an extension for seeding rng
jonatack has joined #lisp
<jackdaniel>
(and can print it readably)
<aeth>
if ECL and SBCL can seed RNG, and you don't care about the seed being portable, then you could write a portability library around seeding (SBCL's random seed is pretty straightforward)
<aeth>
I'm not sure about CCL
<aeth>
and that portability library would work on every implementation if it just falls back to not doing anything if it can't seed
<aeth>
s/anything/any seeding/
nanoz has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #lisp
<jackdaniel>
one thing is that to my knowledge distribution of rng's is uniform and I'm not aware of cl implementations allowing changing that
<jackdaniel>
so if you need non~uniform distribution indeed writing a library seems to be the best choice
shka_ has joined #lisp
isBEKaml has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
Blukunfando has joined #lisp
SaganMan has joined #lisp
m_v_m_m has joined #lisp
hiroaki has joined #lisp
nanoz has joined #lisp
FreeBirdLjj has joined #lisp
lxbarbos` has joined #lisp
random-nick has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
nika has joined #lisp
_whitelogger has joined #lisp
srji has quit [Remote host closed the connection]
nowhere_man has joined #lisp
srji has joined #lisp
<tfb>
White_Flame: all implementations can print random-state objects so they can be read in the same implementation
<tfb>
that's in the spec
<White_Flame>
yeah, that doesn't really help you init one from an integer
pyx has joined #lisp
<White_Flame>
only snapshot some arbitrary one
pyx has quit [Client Quit]
<White_Flame>
besides, this should be working now, with a manual prng
myrkraverk has joined #lisp
FreeBirdLjj has joined #lisp
<tfb>
I guess I don't understand the requirement to seed the PRNG from an integer. That means it can only have as many bits of state as are in a (presumably) fixnum
FreeBirdLjj has quit [Ping timeout: 276 seconds]
<tfb>
But to answer your original question: yes, you can seed a CL RNG in a way which is repeatable in an implementation, just not with an integer
<White_Flame>
implementing another language in CL
<tfb>
I guess I don't understand the requirement to seed the PRNG from an integer. That means it can only have as many bits of state as are in a (presumably) fixnum
<White_Flame>
and that other language has seeding from an integer
<Shinmera>
tfb: It gives you reproducibility.
<Shinmera>
It can also be useful to allow the user to specify a seed easily.
<White_Flame>
moreover, multiple different seeds easily
asdf_asdf_asdf has joined #lisp
<tfb>
Shinmera: CL has that (within an implementation). If you want cross-implementation portability you necessarily have to use a common PRNG algorithm
<White_Flame>
I mean sure, an integer is as arbitrary as any random-state object. But given source code that seeds with an integer, I can't convert that into a random-state object sensibly
<tfb>
White_Flame: yes, obviously you're just dealing with a language with a deficient spec, that's just going to make life hard.
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
wxie has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
varjag has joined #lisp
akoana has left #lisp [#lisp]
orivej has joined #lisp
igemnace has quit [Quit: WeeChat 2.6]
gravicappa has quit [Ping timeout: 245 seconds]
tourjin has joined #lisp
gravicappa has joined #lisp
<White_Flame>
These ,@ clauses should line up, shouldn't they? Does Tab align them probably in your emacs/slime? https://pastebin.com/hSdMmWET
<White_Flame>
I do have parenscript enabled as well
<White_Flame>
erm, paredit I mean
Blukunfando has quit [Ping timeout: 240 seconds]
Blukunfando has joined #lisp
xkapastel has joined #lisp
tourjin has quit [Ping timeout: 245 seconds]
<White_Flame>
If one of my macro parameters is a backquoted list, can I append to it and add comma terms somehow portably?
<no-defun-allowed>
I don't think the representation for backquote is portable at all.
<White_Flame>
I'm trying ,@ games but I don't think they can breach it
<no-defun-allowed>
Though fare-quasiquote replaces the quasiquote reader macros with something consistent.
cosimone has joined #lisp
* White_Flame
is moving from triple-backquote to double-backquote and making it less general in order to work
retropikzel has quit [Remote host closed the connection]
<MichaelRaskin>
Representation of quasiquote is implementation dependent
* no-defun-allowed
moves away from White_Flame, unsure how triple backquote was an attempt to start with
JohanP has joined #lisp
<MichaelRaskin>
Judging from painlessness of it for Agnostic Lizard, I think that most of the options are relatively sane
<White_Flame>
no-defun-allowed: macro which takes backquoted clauses and builds up a defmacro-building defmacro inside it
<MichaelRaskin>
So you could just read "`(a ,b)" and analyze it
JohanP has left #lisp [#lisp]
_whitelogger has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
_whitelogger has joined #lisp
tourjin has joined #lisp
cosimone has quit [Quit: Quit.]
libertyprime has joined #lisp
makomo has joined #lisp
m_v_m_m has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
makomo has quit [Ping timeout: 245 seconds]
nika has quit []
FreeBirdLjj has quit [Ping timeout: 245 seconds]
wxie has quit [Ping timeout: 245 seconds]
tourjin has quit [Ping timeout: 268 seconds]
Inline__ has joined #lisp
Inline has quit [Ping timeout: 264 seconds]
tourjin has joined #lisp
Inline__ has quit [Quit: Leaving]
Inline has joined #lisp
retropikzel has joined #lisp
tourjin has quit [Quit: Leaving]
random-nick has quit [Ping timeout: 250 seconds]
SaganMan has quit [Ping timeout: 276 seconds]
wxie has joined #lisp
retropikzel has quit [Remote host closed the connection]
jao has joined #lisp
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
wxie has quit [Ping timeout: 245 seconds]
retropikzel has joined #lisp
gabiruh has quit [Read error: No route to host]
FreeBirdLjj has joined #lisp
gabiruh has joined #lisp
random-nick has joined #lisp
iovec has joined #lisp
Bike has joined #lisp
isBEKaml has joined #lisp
jao has quit [Ping timeout: 276 seconds]
jao has joined #lisp
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
lxbarbos` has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
trafaret1 has joined #lisp
ym has quit [Read error: Connection reset by peer]
trafaret1 has quit [Client Quit]
EvW1 has joined #lisp
serge has joined #lisp
raghavgururajan has joined #lisp
spowell has quit [Ping timeout: 276 seconds]
lucasb has joined #lisp
kajo has quit [Ping timeout: 245 seconds]
kajo has joined #lisp
nanoz has quit [Quit: Leaving]
bitmapper has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
wxie has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
eSVG has quit [Ping timeout: 250 seconds]
dreamcompiler has joined #lisp
random-nick has joined #lisp
wxie has quit [Ping timeout: 245 seconds]
random-nick has quit [Ping timeout: 245 seconds]
asdf_asdf_asdf has joined #lisp
zaquest has quit [Remote host closed the connection]
wooden has quit [Ping timeout: 268 seconds]
zaquest has joined #lisp
_whitelogger has joined #lisp
dreamcompiler_ has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
dreamcompiler has quit [Ping timeout: 265 seconds]
dreamcompiler_ is now known as dreamcompiler
jao has quit [Ping timeout: 245 seconds]
gabiruh has quit [Ping timeout: 252 seconds]
wooden has joined #lisp
lxbarbosa has joined #lisp
asdf_asdf_asdf has quit [Ping timeout: 268 seconds]
wooden has quit [Ping timeout: 245 seconds]
dreamcompiler_ has joined #lisp
random-nick has quit [Remote host closed the connection]
stepnem has quit [Read error: Connection reset by peer]
dreamcompiler has quit [Ping timeout: 240 seconds]
dreamcompiler_ is now known as dreamcompiler
random-nick has joined #lisp
stepnem has joined #lisp
Kevslinger has joined #lisp
dddddd has joined #lisp
dreamcompiler has quit [Ping timeout: 265 seconds]
asdf_asdf_asdf has joined #lisp
wooden has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
hhdave has joined #lisp
FreeBirdLjj has joined #lisp
EvW1 has quit [Ping timeout: 250 seconds]
raghavgururajan has quit [Read error: Connection reset by peer]
Frobozz has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
Blukunfando has quit [Read error: Connection reset by peer]
ym has joined #lisp
zacts has joined #lisp
<thijso>
Is hashtable access and manipulation thread safe? Or is that implementation dependant?
<Xach>
thijso: implementation
<Xach>
thijso: threads are not addressed by the standard
<Shinmera>
the latter, and it typically is not safe unless you pass extra options.
FreeBirdLjj has quit [Remote host closed the connection]
raghavgururajan has joined #lisp
<asdf_asdf_asdf>
@thijso; type (apropos "hash").
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<beach>
asdf_asdf_asdf: I am not sure whether you saw my remark to you the other day. I was saying that, if you submit code for others to read, you should make sure it respects established conventions in terms of naming and indentation. For example, CamelCase is not used in Common Lisp, and instead, words are lower case, and separated by a hyphen.
<asdf_asdf_asdf>
@beach OK, but what You think?
<thijso>
thanks
<beach>
asdf_asdf_asdf: Exactly what I said. Don't use CamelCase like ThisThingHere. Write this-thing-here instead.
<beach>
asdf_asdf_asdf: And respect the conventions for indentation.
<beach>
asdf_asdf_asdf: And we don't use the `@person' convention here in #lisp. Use `person:' instead.
<asdf_asdf_asdf>
My business (case), whether I use CamelCase whether not.
spowell has joined #lisp
<beach>
asdf_asdf_asdf: You need to observe what other people do and do the same.
<beach>
asdf_asdf_asdf: You can do what you want, but then keep your code to yourself and don't ask for remarks on it.
<beach>
asdf_asdf_asdf: If you ask for remarks, then remarks are what you get.
<asdf_asdf_asdf>
OK, You stop a spam.
<beach>
What?
FreeBirdLjj has quit [Remote host closed the connection]
<asdf_asdf_asdf>
Why are you writing this, I think I know.
<beach>
Good for you.
<asdf_asdf_asdf>
Better find for me, instructions which need to "Between two Sets".
gigetoo has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #lisp
<beach>
asdf_asdf_asdf: I am terribly sorry. I thought you asked for remarks because you wanted your code to be scrutinized by #lisp participants so that you could improve it. I was wrong. I won't make that mistake again.
<ck_>
what is an instruction which needs to between two sets? How do you between in the first place.
<asdf_asdf_asdf>
2 4
<asdf_asdf_asdf>
Result: 4, 8, 16.
FreeBirdLjj has quit [Ping timeout: 245 seconds]
<ck_>
you want powers of two in an integer interval?
<Bike>
there may be some kind of configuration to use unicode?
<asarch>
Reading its documentation, it seems that there is trick for that: (with-http-response (req ent) (with-http-body (req ent :external-format (crlf-base-ef :iso8859-2)) ... generate and write page here..)
<asarch>
By using :utf-8 but I am getting the same results :-(
eSVG has quit [Ping timeout: 250 seconds]
akoana has joined #lisp
EvW1 has joined #lisp
Ven`` has joined #lisp
gravicappa has quit [Ping timeout: 240 seconds]
emacsomancer has joined #lisp
emacsomancer has quit [Client Quit]
andrei-n has joined #lisp
ggole has quit [Quit: Leaving]
karlosz has quit [Quit: karlosz]
permagreen has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
_jrjsmrtn has joined #lisp
asarch has quit [Remote host closed the connection]
__jrjsmrtn__ has quit [Ping timeout: 246 seconds]
davr0s_ has joined #lisp
davr0s has joined #lisp
fragamus has joined #lisp
zaltekk has joined #lisp
fragamus has quit [Ping timeout: 245 seconds]
fragamus has joined #lisp
gabiruh has joined #lisp
karlosz has joined #lisp
manualcrank has joined #lisp
vlatkoB has quit [Remote host closed the connection]
iovec has joined #lisp
andrei-n has quit [Remote host closed the connection]
shka_ has quit [Ping timeout: 240 seconds]
adip has quit [Ping timeout: 265 seconds]
permagreen has joined #lisp
sardonumpsa has joined #lisp
nanoz has quit [Ping timeout: 240 seconds]
adip has joined #lisp
analogue has quit [Quit: Leaving]
superkumasan has joined #lisp
asdf_asdf_asdf has joined #lisp
lxbarbosa has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 268 seconds]
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
monokrom has quit [Remote host closed the connection]
caltelt has joined #lisp
varjag has quit [Ping timeout: 240 seconds]
dreamcompiler has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
nowhere_man has joined #lisp
igemnace has quit [Quit: WeeChat 2.6]
eSVG has joined #lisp
fragamus has quit [Ping timeout: 246 seconds]
dreamcompiler has quit [Ping timeout: 276 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
libertyprime has quit [Ping timeout: 245 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #lisp
karlosz has quit [Quit: karlosz]
libertyprime has joined #lisp
sfa has joined #lisp
kamog has joined #lisp
<remexre>
so I've got a tree of objects, where the leaves can either be of class optimized-leaf or unoptimized-leaf (for example's sake, let's say optimized-leaf is a bit-vector and unoptimized-leaf is a (vector t))
<remexre>
I want to be able to write values that are trits, where (deftype trit () '(or bit (eql :mu)))
<remexre>
would the implementation of (write-trit LEAF TRIT) be a reasonable use of change-class?
<remexre>
and if not, is there a better way to do this
karlosz has joined #lisp
Oladon has joined #lisp
cosimone has quit [Ping timeout: 245 seconds]
analogue has joined #lisp
ltriant has joined #lisp
sfa has quit [Quit: leaving]
Aruseus has joined #lisp
dale has joined #lisp
Aruseus has quit [Remote host closed the connection]
Aruseus has joined #lisp
<stylewarning>
remexre: if it’s truly bit vectors, why not split the difference and use a specialized array of (UNSIGNED-BYTE 2) or so?
<remexre>
it's not actually bitvectors :P they're just an example of a representation that can densely store data, but aren't compatible with all the values I wanna store
<stylewarning>
remexre: Would everything start optimized, then possibly be unoptimized? If the tree is the “owner” of the leaves, I think it’s preferable to mutate the tree instead of changing the class. If the objects are strewn around everywhere, then maybe it’s easier to use change class
<remexre>
pretty much, yeah; the tree does own the leaves, i.e. the existence of the leaves is an implementation detail
<remexre>
in your version, would the (write-trit LEAF TRIT) return a new LEAF, then?
<stylewarning>
I probably wouldn’t have a WRITE-TRIT function, I’d have functions to operate on the tree instead, and down deep I’d have %WRITE-BIT and %WRITE-TRIT which work on the storages directly
<stylewarning>
that is, id want to dispatch on the value as soon as possible, not at the last moment when all I’ve got is a lead
<stylewarning>
leaf*
<remexre>
so would WRITE-TRIT-TO-TREE test the leaf types, and do some sorta (setf (left tree) (promote (left tree)))-looking thing?
<stylewarning>
Yes
<remexre>
hm, ok
<stylewarning>
Is there any case in which you’d optimize when you write a trit?
<stylewarning>
Probably not, you’d need to inspect all values