Skip to content

Commit 9caa98d

Browse files
committed
notes
1 parent 512dfd5 commit 9caa98d

2 files changed

Lines changed: 52 additions & 7 deletions

File tree

notes/cli/linux.scrbl

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,13 +1692,38 @@
16921692
# 3. Format partition as ext4 (or ext2 or ext3):
16931693
sudo mkfs.ext4 $diskPart -L <lbl-fsys-...> # -L <volume-label>
16941694
#
1695-
# 4. verify:
1695+
# 4. verify with:
16961696
lsblk --output \
16971697
FSTYPE,PARTTYPE,PATH,MODEL,TRAN,LABEL,SIZE,PARTLABEL,MOUNTPOINTS \
16981698
| sed 's/PARTLABEL/PARTLBL /g' | sed 's/LABEL/FSLBL/g'
1699-
#
1699+
# 4. ... or verify also with:
17001700
sudo parted $diskRoot print
1701+
# Model: VendorCo ProductCode (scsi)
1702+
# Disk /dev/sdd: 31.5GB
1703+
# Sector size (logical/physical): 512B/512B
1704+
# Partition Table: msdos
1705+
# Disk Flags:
1706+
#
1707+
# Number Start End Size Type File system Flags
1708+
# 2 1185MB 1188MB 2949kB primary esp
1709+
#
1710+
# 4. ... or verify also with:
17011711
sudo fdisk --list $diskRoot
1712+
# Disk /dev/sdd: 29.3 GiB, 31457280000 bytes, 61440000 sectors
1713+
# Disk model: ProductCode
1714+
# Units: sectors of 1 * 512 = 512 bytes
1715+
# Sector size (logical/physical): 512 bytes / 512 bytes
1716+
# I/O size (minimum/optimal): 512 bytes / 512 bytes
1717+
# Disklabel type: dos
1718+
# Disk identifier: 0x00000000
1719+
#
1720+
# Device Boot Start End Sectors Size Id Type
1721+
# /dev/sdd1 * 0 2315063 2315064 1.1G 0 Empty
1722+
# /dev/sdd2 2315064 2320823 5760 2.8M ef EFI (FAT-12/16/32)
1723+
#
1724+
# 4. ... or verify also with:
1725+
sudo file --special-files $diskRoot
1726+
# /dev/sdd: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'GUIX_X86_64-LINUX_1.5.0' (bootable)
17021727
#
17031728
# In the context of Linux tools like blkid and lsblk, it is not possible to
17041729
# assign a custom label directly to the entire hard drive (as opposed to

notes/guix-guile-nix/guile.scrbl

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
(iota 6) ⇒ (0 1 2 3 4 5)
5353
(iota 4 2.5 -2) ⇒ (2.5 0.5 -1.5 -3.5)
5454

55-
(define my-list '(a b c d e))
56-
(list-ref my-list 2) ;; nth element of a list
55+
(define my-list '(a0 b1 c2 d3 e4))
56+
(list-ref my-list 2) ;; => c2 (nth element of a list)
5757

5858
https://sourcegraph.com/search
5959
https://sourcehut.org
@@ -118,10 +118,16 @@
118118
(unspecified? *unspecified*) ; => #t
119119
;; The evaluated expression has no result specified:
120120
(equal? (when #f #t) *unspecified*) ; => #t
121+
;; However:
122+
(equal? (when #f #t)) ; => #t
123+
(equal? *unspecified*) ; => #t
124+
;; *unspecified* is truthy. WTF!?!
125+
(if (when #f #t) #t #f) ; => #t
126+
(if *unspecified* #t #f) ; => #t
121127
;; *unspecified* is a value apart from both: empty list and boolean false
122-
(eq? *unspecified* '()) ; => #f
123-
(eq? *unspecified* #f) ; => #f
124-
(eq? *unspecified* #t) ; => #f
128+
(eq? *unspecified* '()) ; => #f
129+
(eq? *unspecified* #f) ; => #f
130+
(eq? *unspecified* #t) ; => #f
125131

126132
Tail Call Optimisation
127133
the compiler will rewrite the recursive form into a serialised iterative form.
@@ -505,6 +511,7 @@
505511
(odd? (lambda (n) (if (zero? n) #f (even? (- n 1))))))
506512
(even? 88))
507513

514+
(use-modules (srfi srfi-88)) ; provides keyword objects
508515
(keyword? #:foo) ;; => #t
509516
;; (keyword? :foo) ;; => error
510517
;; (keyword? foo:) ;; => error
@@ -566,3 +573,16 @@
566573
Scheme[2][3] and are available in the GNU Guile implementation of that
567574
language.
568575
}
576+
577+
@block{@block-name{Exactness}
578+
;; https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Exactness.html
579+
(exact? 2) ; ⇒ #t
580+
(exact? 0.5) ; ⇒ #f
581+
(exact? (/ 2)) ; ⇒ #t
582+
(inexact->exact 0.5) ; ⇒ 1/2
583+
;; 12/10 is not exactly representable as a double (on most platforms).
584+
;; However, when reading a decimal number that has been marked exact with the
585+
;; "#e" prefix, Guile is able to represent it correctly.
586+
(inexact->exact 1.2) ; ⇒ 5404319552844595/4503599627370496
587+
#e1.2 ; ⇒ 6/5
588+
}

0 commit comments

Comments
 (0)