Skip to content

Commit 324ce7e

Browse files
authored
Update README.md
1 parent 8cdb8fd commit 324ce7e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ import livecoding
4545
class MyClass(livecoding.LiveObject):
4646
```
4747
If you dont want to subclass LiveObject then all you have to do is take a look at that class and try to add similar functionality to your class. Which means your class must have a class variable called ```instances``` and that each time an instance is created that instance is added to that variable. For example
48+
```py
49+
class MyLiveObjectClass:
50+
instances=[]
4851

52+
def __init__(self):
53+
self.__class__.instances.append(self)
4954

50-
55+
```
5156
Thats all you have to do and you can code as you awlays code following whatever style you want.
5257
# Debugging live coding
5358
Traditional debugging compared to live code debugging is like fire compared to nucleal power. Because not only you see the problems in your source code you can change the live code while still the debugger is stepping through your code. This allows coding Smalltalk style. In Smalltalk some coders code entirely inside the debugger, they make intential mistakes under the safety that they can correct their errors with no delays at all because there is no need to restard the debugger and each new error triggers the debugger again.When the error is fixed via live coding, the breakpoint can be removed and the debugger instructed to continue execution like nothing happened.

0 commit comments

Comments
 (0)