Commit Graph

16 Commits

Author SHA1 Message Date
efim 586f06fbf2 previous koans, conditions
complex stuff, unpleasant for now
2022-08-16 18:18:30 +00:00
efim b4fe711abb koans with signals, errors and stuff
this is a bit complicated, espeially with different objects representing conditions
and how hard it is to check inner parts of expressions
2022-08-11 12:36:22 +00:00
efim f4759c5685 koans, looks like exception handling with signals 2022-08-07 16:13:43 +00:00
efim 6f09e0019c koans clog defgeneric
so, there's advice qualifiers for DEFMETHOD
and they have "standard combination"
http://www.lispworks.com/documentation/HyperSpec/Body/07_ffb.htm
:around and primary methods can call CALL-NEXT-METHOD can be used to
invoke a less specific method for the class
:before and :after are all always called as a onion with most specific
on the outside
2022-08-06 09:34:49 +00:00
efim 4cfca2c9c3 koans - clos and advice
objects similar to structures, but can have "generic" setters and creators
generic methods can have methods with qualifier :before :after :around
that in a way I don't fully understand registers them to be launched
with original function?
2022-08-06 09:00:44 +00:00
efim b7bccb9cfb koans on types and clos
- types are complicated, not sure how to look up documentation for it
would they show up in apropos all?
- list formatted types - like array vector can specify type of element,
rank / dimentions
(not sure there's variancy over the element type?)
- clos - similar to structure
for structured you get separate functions to get slots, use setf to set
generalized variables
with classes, I can use generic function to create #'make-instance
and access slots with (#'slot-value instance 'slot-name)
but there could be defined accessor, reader, writer,
and :initarg to name slot to have handle to set value in constructor

now that's a lot
2022-08-03 20:43:31 +00:00
efim c85aa1bbe5 koans FORMAT
there are list printing things, each ~A takes element out of list
there's case adjustment for strings, and ~S is to be able to read things
in again
2022-08-01 07:49:12 +00:00
efim a9bdaaccee new from koans, loops and coding
- loops can be "ON" a list, then iterate over structure, and can be BY 'cddr and such
- looping over hashtables seems painful
- during coding didn't think about getting debugger,
  couldn't figure out how to do it without BREAK, and in DO loop didn't
  see separate frames
- again remembered MAKUNBOUND for if I try to set values during debugger
2022-07-31 12:14:21 +00:00
efim 9c64cf128f buch of things to remind myself
- characters are # and non-excape, #\a
- i am way to quick to judge pairwise operations from left with #'reduce
- iteration can be actually simple with dotimes, dolist.
  i'm quite afraid of #'loop but #'do seems cool and inviting
2022-07-30 18:33:04 +00:00
efim e076e76575 new things about function parameters
- key params are after &rest, and get put into &rest in order of call
appearance
- can have closure around same place / generalized varialbe, holy cow
- apply takes list, but can also take several arguments with last one
being a list
2022-07-29 07:42:25 +00:00
efim 8865b0df6a function parameters
both optional and keyword parameters can include both default value AND
'providedp' predicate of whether they were provided
2022-07-28 19:10:31 +00:00
efim 89673df888 new thing - functions returning multiple values
(values 1 2 3) at the tnd of funtion fill make funciton return 1, 2, 3
and I can either treat function as returning single value,
or use functions like multiple-value-list or multiple-value-[bind|setq]
to get secodary return values

so not quite like a tuple
2022-07-28 15:35:14 +00:00
efim 6dcca61283 cool about arrays and vectors
arrays have #'array-dimentions and #'array-rank (as a matrix)
and there's cool (row-major-aref my-arr index) for indexing array with
single index, going throug all elements

vectors have literal notation #(1 2 4 1),
they are one dimentional
have :element-type key in constructor, not quite sure how to use that

and we can try to #'coerce list to something else by providing symbol
for type, which we could get from (type-of my-vector)

also literal notation for byte vectors, cool #*110011001
2022-07-26 12:18:42 +00:00
efim ce9c7ac999 koans, lists
subsist not including right part
2022-07-25 07:45:38 +00:00
efim fd03924c10 learning koans
- refreshed understanding of lexical vs. dynamic binding
  https://gigamonkeys.com/book/variables.html
- was taught CASE as simpler variant of COND
2022-07-24 13:18:22 +00:00
efim 49c00c24ee pulled in lisp koans for solving
https://github.com/google/lisp-koans
2022-07-24 12:18:03 +00:00