!iNkFOAFNSlAAUKgcCT:matrix.org

lisp

717 Members
All things lisp: cl, scheme, racket, clojure etc99 Servers

Load older messages


SenderMessageTime
6 Jun 2020
@xgqt:matrix.orgxgqt How can i read a file in racket?
I tried file->list but that seems to be syntax aware?
02:55:31
@david:pflug.emailDavid If file->lines doesn't do what you want, try https://docs.racket-lang.org/reference/file-ports.html 11:56:13
@xgqt:matrix.orgxgqt

David: yes, but i dont quite know what i want 😅
found this on on the net:

(define (next-line-it file)
  (let ((line (read-line file 'any)))
    (unless (eof-object? line)
      (displayln line)
      (next-line-it file))))

(define (show-file file)
  (call-with-input-file file next-line-it))

seems to do the job for me

12:00:40
@xgqt:matrix.orgxgqtdo you think there may be a better way to do it?12:00:59
@luismbo:matrix.orgluismboSo, you want to read the file in and display it, is that it?12:20:06
@xgqt:matrix.orgxgqtexactly12:20:18
@xgqt:matrix.orgxgqtI just got into Racket so excuse my stupid questions 😁 The most lisp/scheme i had was emacs which I use everyday but I wasn't seriously programming in elisp or similar languages.12:32:47
@luismbo:matrix.orgluismbo What don't you like about file->lines? 16:02:49
@xgqt:matrix.orgxgqtweird, works ok now16:04:33
@xgqt:matrix.orgxgqti got some syntax error16:04:44
@xgqt:matrix.orgxgqtlike it tried to load that file16:04:52
@xgqt:matrix.orgxgqti dont rememebr sorry16:05:00
@luismbo:matrix.orgluismbo You mentioned file->list before, which is different. 16:05:30
@xgqt:matrix.orgxgqtah, i guess thats where the error was16:06:12
7 Jun 2020
@xgqt:matrix.orgxgqt

after installing tge pkg rash in raco setup i get the following message

raco setup: 4 skipping: <pkgs>/racket-doc/xml/xml.scrbl               raco setup: 0 skipping: <pkgs>/racket-index/scribblings/main/local-redirect.scrbl                                                           raco setup: 7 skipping: <pkgs>/racket-index/scribblings/main/search.scrbl                                                                   raco setup: docs failure: query-exec: unable to open the database file  error code: 14
  SQL: "ATTACH $1 AS other"                                             database: #<path:/home/ahm/.racket/7.0/doc/docindex.sqlite>           mode: 'read-only                                                      file permissions: (write read)                                      raco setup: --- installing collections ---                            raco setup: --- post-installing collections ---                       raco pkg install: packages installed, although setup reported errors

aanybody knows what "error 14" means?

08:52:38
@xgqt:matrix.orgxgqt the db exists under my user's home with file permissions 644 08:54:19
@vvra:matrix.orgvvra joined the room.14:27:22
8 Jun 2020
@xgqt:matrix.orgxgqtsolved: my docs were broken18:33:03
9 Jun 2020
@gisela:feneas.orggisela 22:09:39
@hideyo:matrix.orghideyo joined the room.14:18:26
12 Jun 2020
@even4void:matrix.org@even4void:matrix.org joined the room.16:02:13
13 Jun 2020
@ksawery:junta.plksawery left the room.19:53:08
14 Jun 2020
@mrtn:hackeruniverse.dkMrtn Dk
In reply to @xgqt:matrix.org
solved: my docs were broken
That sucks. Did you fix the docs?
17:50:26
@xgqt:matrix.orgxgqt Mrtn Dk: they were broken on my side
I fixed the ebuild (install script)
17:52:28
@mrtn:hackeruniverse.dkMrtn Dk
In reply to @xgqt:matrix.org
Mrtn Dk: they were broken on my side
I fixed the ebuild (install script)
Which distribution?
17:58:53
@xgqt:matrix.orgxgqt Mrtn Dk: Gentoo(well, ebuilds are only in 2) 18:01:52
@mrtn:hackeruniverse.dkMrtn Dk
In reply to @xgqt:matrix.org
Mrtn Dk: Gentoo(well, ebuilds are only in 2)
Cool. I used to run Gentoo many years ago. I loved many of the features such as overlays. If I remember correctly, it will I'm theory allow me to create a patch locally, that will be applied on future updates as well.
18:12:29
@xgqt:matrix.orgxgqttrue i prefer to create whole ebuilds rather than patches only18:14:09
@david:pflug.emailDavidGuix can do similar, and uses Guile Scheme as it's config system/packaging language.18:25:03
@xgqt:matrix.orgxgqt David: really? didnt know i can compile from source with guix 18:28:53

Show newer messages


Back to Room ListRoom Version: