Skip to content

Commit 1661f09

Browse files
authored
Merge pull request #381 from vindarel/master
Discovering the Lispworks IDE
2 parents 7ff9aab + 8c9b362 commit 1661f09

13 files changed

+609
-39
lines changed

assets/lispworks/class-browser.png

119 KB
Loading
54.9 KB
Loading
45.6 KB
Loading

assets/lispworks/stepper.gif

14.2 KB
Loading
14.4 KB
Loading
190 KB
Loading

assets/style.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,31 @@ ul ul{
173173
ul ul ul{
174174
margin-left:-26px;
175175
}
176+
177+
// Alert / Info boxes
178+
179+
.info-box {
180+
// note: if element is inside a <p> then bootstrap adds 10px padding to the bottom.
181+
padding: 17px;
182+
}
183+
184+
.danger {
185+
background-color: #ffdddd;
186+
border-left: 6px solid #f44336;
187+
}
188+
189+
.success {
190+
background-color: #ddffdd;
191+
border-left: 6px solid #4CAF50;
192+
}
193+
194+
.info {
195+
background-color: #e7f3fe;
196+
border-left: 6px solid #2196F3;
197+
}
198+
199+
200+
.warning {
201+
background-color: #ffffcc;
202+
border-left: 6px solid #ffeb3b;
203+
}

data-structures.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,45 @@ Hash Tables are created using the function
822822
has no required argument. Its most used optional keyword argument is
823823
`:test`, specifying the function used to test the equality of keys.
824824

825-
_Note_: see shorter notations in the [Serapeum](https://github.com/ruricolist/serapeum/) or [Rutils](https://github.com/vseloved/rutils) libraries. For example, Serapeum has `dict`, and Rutils a `#h` reader macro.
825+
<div class="info-box info">
826+
<strong>Note:</strong> see shorter notations in the <a href="https://github.com/ruricolist/serapeum/">Serapeum</a> or <a href="https://github.com/vseloved/rutils">Rutils</a> libraries. For example, Serapeum has <code>dict</code>, and Rutils a <code>#h</code> reader macro.
827+
</div>
828+
829+
<a name="add"></a>
830+
831+
### Adding an Element to a Hash Table
832+
833+
If you want to add an element to a hash table, you can use `gethash`,
834+
the function to retrieve elements from the hash table, in conjunction
835+
with
836+
[`setf`](http://www.lispworks.com/documentation/HyperSpec/Body/m_setf_.htm).
837+
838+
~~~lisp
839+
CL-USER> (defparameter *my-hash* (make-hash-table))
840+
*MY-HASH*
841+
CL-USER> (setf (gethash 'one-entry *my-hash*) "one")
842+
"one"
843+
CL-USER> (setf (gethash 'another-entry *my-hash*) 2/4)
844+
1/2
845+
CL-USER> (gethash 'one-entry *my-hash*)
846+
"one"
847+
T
848+
CL-USER> (gethash 'another-entry *my-hash*)
849+
1/2
850+
T
851+
~~~
852+
853+
With Serapeum's `dict`, we can create a hash-table and add elements to
854+
it in one go:
855+
856+
~~~lisp
857+
(defparameter *my-hash* (dict :one-entry "one" :another-entry 2/4))
858+
;; =>
859+
(dict
860+
:ONE-ENTRY "one"
861+
:ANOTHER-ENTRY 1/2
862+
)
863+
~~~
826864

827865
<a name="get"></a>
828866

@@ -861,30 +899,6 @@ library (in Quicklisp) has the functions `hash-table-keys` and
861899
;; => (BAR)
862900
~~~
863901

864-
<a name="add"></a>
865-
866-
### Adding an Element to a Hash Table
867-
868-
If you want to add an element to a hash table, you can use `gethash`,
869-
the function to retrieve elements from the hash table, in conjunction
870-
with
871-
[`setf`](http://www.lispworks.com/documentation/HyperSpec/Body/m_setf_.htm).
872-
873-
~~~lisp
874-
CL-USER> (defparameter *my-hash* (make-hash-table))
875-
*MY-HASH*
876-
CL-USER> (setf (gethash 'one-entry *my-hash*) "one")
877-
"one"
878-
CL-USER> (setf (gethash 'another-entry *my-hash*) 2/4)
879-
1/2
880-
CL-USER> (gethash 'one-entry *my-hash*)
881-
"one"
882-
T
883-
CL-USER> (gethash 'another-entry *my-hash*)
884-
1/2
885-
T
886-
~~~
887-
888902

889903
<a name="test"></a>
890904

error_handling.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,12 @@ able to populate it with information to be consumed later:
184184
;; #<MY-DIVISION-BY-ZERO {1005C18653}>
185185
~~~
186186

187-
Note: here's a quick reminder on classes, if you are not fully operational
188-
on the [Common Lisp Object System](clos.html):
187+
<div class="info-box info">
188+
<p>
189+
<strong>Note:</strong> here's a quick reminder on classes, if you are not fully operational
190+
on the <a href="clos.html">Common Lisp Object System</a>.
191+
</p>
192+
</div>
189193

190194
~~~lisp
191195
(make-condition 'my-division-by-zero :dividend 3)

files.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: Files and Directories
33
---
44

5-
Note: In this chapter, we use mainly
5+
We'll see here a handful of functions and libraries to operate on files and directories.
6+
7+
In this chapter, we use mainly
68
[namestrings](http://www.lispworks.com/documentation/HyperSpec/Body/19_aa.htm)
79
to
810
[specify filenames](http://www.lispworks.com/documentation/HyperSpec/Body/19_.htm). The
@@ -30,6 +32,9 @@ either `nil` if the file doesn't exists, or its
3032
[truename](http://www.lispworks.com/documentation/HyperSpec/Body/20_ac.htm)
3133
(which might be different from the argument you supplied).
3234

35+
For more portability, use `uiop:probe-file*` or `uiop:file-exists-p`
36+
which will return the file pathname (if it exists).
37+
3338
~~~lisp
3439
$ ln -s /etc/passwd foo
3540
@@ -43,9 +48,6 @@ $ ln -s /etc/passwd foo
4348
NIL
4449
~~~
4550

46-
For more portability, use `uiop:probe-file*` or `uiop:file-exists-p`
47-
which will return the file pathname (if it exists).
48-
4951
### Expanding a file or a directory name with a tilde (`~`)
5052

5153
For portability, use `uiop:native-namestring`:

0 commit comments

Comments
 (0)