« first day (827 days earlier)
← previous day
next day →
last day (708 days later) »
Razetime
4:07 PM
what are the methods of file i/o in K?
rak1507
which one
Razetime
let's say oK because that's what I've learned first
nvm that's in js
let's say ngn/k
ngn
@Razetime
1:"file"
to read bytes,
"file"1:"data"
to write bytes,
0:"file"
to read lines,
"file"0:("line0";"line1")
to write lines
Razetime
1:
is the word there right
sounds simple enough
how do i use ngn/k on a file?
./k filename?
ngn
@Razetime yes, verbs like
1:
are parsed as a single token (
:
there is not something separate like a "hyperator")
@Razetime yes
Razetime
4:19 PM
ah great
ngn
./k filename
loads the file (usually they have a
.k
extension, but it's not enforced) and evaluates it as if it's typed line by line
Razetime
will be back with more simple questions(or hard ones)
ngn
always welcome
Razetime
is repl.k partly a cheatsheet or is there some other file I can refer to
ngn
@Razetime like
the manual
?
Razetime
4:24 PM
yeah something like it
just a quick refereence with name and a few one liner examples
ngn
@Razetime if you're using
./k repl.k
and type \ it should give you one liner examples for most stuff
Razetime
hm cool
I'll just copy that and put it in a separate file
ktye
@Razetime
ktye.github.io/ref/ref.html
(you can click on a line to expand) (might be out of date)
ngn
when you type \: it prints examples for i/o verbs
Razetime
this may be a wsl thing but idk
./k doesn't seem to work
ktye
4:35 PM
@Razetime k.c is a source file. you need to compile first.
Razetime
oh ok
Razetime
4:46 PM
@ktye do you plan on nominating this for LoTM?
ngn
@Razetime does wsl have a "make" command?
Razetime
@ngn yep, I'm installign clang now
I like graphical output question so I'm interested
Razetime
5:25 PM
i have acquired the k build
ngn
5:35 PM
great
1 hour later…
coltim
6:36 PM
@ngn I have a
pair
of segfaults/crashes
ngn
6:47 PM
@coltim thanks! i'll look into them tomorrow
coltim
7:02 PM
also I found a use for deep-where! @rak1507's
CMC
, which, if I understand correctly, can be done with
this
rak1507
it solves the problem but not in under o(n^2) time
1 hour later…
coltim
8:28 PM
hmph, true. I think
this
has better time complexity
coltim
8:46 PM
also, I dunno what's going on with
these
, but I sense golfing opportunities...
« first day (827 days earlier)
← previous day
next day →
last day (708 days later) »
all rooms
Transcript for
Jun
11
Jun '21
12
Jun
13
the k tree
app.element.io/#/room/#ngnk:matrix.org
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile