nma.arvydas.silanskas
2019-8-16 14:33:22

@lexi.lambda do you have plans reviving hackett?


jaz
2019-8-16 14:56:19

Yup, sorry, not a mistake at all.


soegaard2
2019-8-16 15:54:52

@stchang Is there a way to get the position in Parsack? I ask because Greg’s toml parser used: (define (getPosition) (match-lambda [(and state (State _ pos -)) (Empty (Ok pos state (Msg pos "" null)))])) but the current version of Parsack doesn’t export State.


sorawee
2019-8-16 16:04:05

@soegaard2 as I understand, the position is only needed for error reporting. I tried removing pos-related code yesterday and managed to get it runnable. Not a good solution though.

The best solution IMO is to specify in info.rkt that “please use this version of parsack instead”. But #:version in info.rkt is only for lower bound, not upper bound :disappointed:


soegaard2
2019-8-16 16:05:36

I am surprised we haven’t seen a foo1, foo2, foo3 … situation on the package server.


soegaard2
2019-8-16 16:06:01

But since toml it self is a parser, the error positions are needed.


soegaard2
2019-8-16 16:06:16

Can we get the position form the input port instead?


soegaard2
2019-8-16 16:28:47

soegaard2
2019-8-16 16:29:26

The next commit changes parsack to use ports instead of strings - and it no longer exports Pos, Msg and other stuff.


soegaard2
2019-8-16 16:29:51

Does it make sense to make a repo called parsack-old ?


sorawee
2019-8-16 16:32:19

@soegaard2 if you will do it, I’d suggest using the code right before this commit instead


soegaard2
2019-8-16 16:33:07

I thought that was the one I had found?


soegaard2
2019-8-16 16:34:07

Maybe @stchang wants to?


sorawee
2019-8-16 16:35:17

You are right. The commit you found is right before the commit I found. :face_palm:


soegaard2
2019-8-16 16:36:36

Perhaps there is an easy way to check out the proper version, if the command line raco pkg is used? /checks


alexknauth
2019-8-16 16:40:22

Does raco pkg install <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> work?


soegaard2
2019-8-16 16:42:38

@alexknauth I’ll try. This didn’t: mbp:tmp soegaard$ raco pkg install --checksum de85745c1023a0177d16efd6fe16a1 parsack Resolving "parsack" via <https://download.racket-lang.org/releases/7.3/catalog/> Resolving "parsack" via <https://pkgs.racket-lang.org> Using cached15659698591565969859745 for <github://github.com/stchang/parsack/master/> raco pkg install: unexpected checksum on package package source: parsack expected: "de85745c1023a0177d16efd6fe16a1" got: "b45f0f5ed5f8dd3f1ccebaaec3204b27032843c6"


sorawee
2019-8-16 16:44:18

raco pkg install '<git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1>' works for me


soegaard2
2019-8-16 16:44:23

Nope. mbp:tmp soegaard$ raco pkg install <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> Querying Git references for parsack at <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> Using cached15659737761565973776575 for <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> raco setup: directory: #&lt;path:/Users/soegaard/tmp/parsack/parsack&gt; does not exist for collection: "parsack" context...: /Applications/Racket v7.3/collects/setup/setup-core.rkt:354:2: collection-cc!20 /Applications/Racket v7.3/collects/setup/setup-core.rkt:503:8: for-loop ...


soegaard2
2019-8-16 16:45:14

And it doesn’t used a cached version?


sorawee
2019-8-16 16:45:17

> Using cached15659737761565973776575 for

This line is very suspicious.


sorawee
2019-8-16 16:45:32
Querying Git references for parsack at <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1>
Downloading repository <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1>
raco setup: version: 7.4
raco setup: platform: x86_64-macosx [3m]
raco setup: target machine: racket

sorawee
2019-8-16 16:45:34

Here’s mine


sorawee
2019-8-16 16:45:46

Perhaps try clearing the cache?


soegaard2
2019-8-16 16:47:36

Easier said than done. I get an error: mbp:tmp soegaard$ raco pkg remove parsack Removing parsack Moving parsack to trash: /Users/soegaard/Library/Racket/7.3/pkgs/.trash/1565974010-0-parsack raco setup: directory: #&lt;path:/Users/soegaard/tmp/parsack/parsack&gt; does not exist for collection: "parsack" context...: /Applications/Racket v7.3/collects/setup/setup-core.rkt:354:2: collection-cc!20


soegaard2
2019-8-16 16:48:12
mbp:tmp soegaard$ raco pkg empty-trash
Removing trash directory /Users/soegaard/Library/Racket/7.3/pkgs/.trash/1565973991-0-parsack
Removing trash directory /Users/soegaard/Library/Racket/7.3/pkgs/.trash/1565974010-0-parsack
mbp:tmp soegaard$ raco pkg install "<git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1>"
raco pkg install: package is already installed
  package: parsack

sorawee
2019-8-16 16:48:48

Huh, some invariants are broken apparently :slightly_smiling_face:


soegaard2
2019-8-16 16:50:42

I am confused: mbp:tmp soegaard$ raco link -l \| grep parsack collection: "parsack" path: "/Users/soegaard/tmp/parsack/parsack" root path: "/Users/soegaard/Library/Racket/7.3/pkgs/parsack" mbp:tmp soegaard$ raco link -r parsack [no links removed]


sorawee
2019-8-16 16:52:15

Here’s an idea: install Racket 7.4 :joy:


soegaard2
2019-8-16 16:52:41

I do have 7.4. Need to adjust my path :slightly_smiling_face:


alexknauth
2019-8-16 16:52:54

If you already have parsack installed maybe replace install with update


soegaard2
2019-8-16 16:53:26

No updates available.


alexknauth
2019-8-16 16:54:48

So raco pkg update <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> says no updates available?


soegaard2
2019-8-16 16:55:22

Yes. mbp:tmp soegaard$ raco pkg update "<git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1>" Querying Git references for parsack at <git://github.com/stchang/parsack#beddbd2ba7de85745c1023a0177d16efd6fe16a1> No updates available


soegaard2
2019-8-16 16:55:55

At some point I cloned parsack and made a link.


soegaard2
2019-8-16 16:56:27

Then I deleted the directory, and then unlinked (or was it the other way around).


soegaard2
2019-8-16 17:01:23

Hmm. Seems toml now works.


soegaard2
2019-8-16 17:01:41

Still confused though.


soegaard2
2019-8-16 17:05:26

FWIW I think creating an empty tmp/parsack/parsack folder helped (that’s why setup failed).


soegaard2
2019-8-16 17:05:40

Still can’t unlink properly.


darioszr
2019-8-16 18:00:47

@darioszr has joined the channel


winny
2019-8-17 02:33:13

Is it possible to convet a bytes that contains UTF–16BE to a string? I see the bytes-open-converter supports UTF–16 but appears to use platform endianness only (as indicated by the docs - https://docs.racket-lang.org/reference/bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-open-converter%29%29 )


samdphillips
2019-8-17 02:54:26

I think UTF–16be is a legal encoding in bytes-open-converter

(for/list ([to '("UTF-16" "UTF-16be")])
  (let ([xf (bytes-open-converter "UTF-8" to)])
    (let-values ([(b _x _y) (bytes-convert xf #"hello world")])
      b)))

==&gt; '(#"\376\377\0h\0e\0l\0l\0o\0 \0w\0o\0r\0l\0d" #"\0h\0e\0l\0l\0o\0 \0w\0o\0r\0l\0d")

samdphillips
2019-8-17 03:00:06

philip.mcgrath
2019-8-17 03:19:28

@nma.arvydas.silanskas I was thinking of data conversion for serializable continuations: serializable-struct won’t help you with conversion to or from JSON. If I were doing enough conversions that writing them manually became painful, I would either: 1. Write some macros for defining structs that know how to convert themselves to and from JSON; or 2. Just manipulate the data as hash tables, possibly with convenience functions or macros for things like nested hash-ref/hash-update. I think there are some packages for this, and I know I’ve written my own versions occasionally.


winny
2019-8-17 04:01:01

Excellent! Thank you a bunch!