4 ms·
There are some Lisp-related things which provide developers with new tools and new ways to think, maybe making them better: a) code as data b) interactive sof
by lispm 10y ago
There are some Lisp-related things which provide developers with new tools and new ways to think, maybe making them better:
a) code as data
b) interactive software development
c) user-defined language extensions where the developer is part-time language designer, syntactic abstraction
d) dynamic object-oriented programming
e) meta-object programming
- AnimalMuppet 10y agoCould you expand on d)? What specifically is different between what you get with Lisp here and OO in the C++/Java sense?
- lispm 10y agoCommon Lisp allows us to develop object oriented software while it is running. Interactively. It changes classes and other objects, based on programmer changes. We can also add behavior to OOP mechanisms, like instance creation, slot allocation, slot access, class redefinition. One can add/change/delete methods at runtime. You can even change the class of an instance. This enables you to have large OO applications running and change them while they are running. This enables interactive incremental development. Interaction with LispWorks: Define a class with a slot. CL-USER 61 > (defclass person () ((name :initarg :name))) #<STANDARD-CLASS PERSON 4020002153> Create an instance of that class. CL-USER 62 > (defparameter *p1* (make-instance 'person :name "Drumpf")) *P1* What is it? CL-USER 63 > (describe *p1*) #<PERSON 402000DE43> is a PERSON NAME "Drumpf" Hmm, let's make a politician class, with person as superclass and a slot TYPE. CL-USER 64 > (defclass politician (person) ((type :initarg :type))) #<STANDARD-CLASS POLITICIAN 4020284743> We change our object to the new class and add information about the new slot content: CL-USER 65 > (change-class *p1* 'politician :type 'populist) #<POLITICIAN 402000DE43> What is it now? CL-USER 66 > (describe *p1*) #<POLITICIAN 402000DE43> is a POLITICIAN TYPE POPULIST NAME "Drumpf" Class of the instance has changed, the new slot has been added, and the old slot is still there.
- junke 10y agoIf you try this at home, don't forget to clean your environment afterward: (mkunbound '*p1*)