rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot>
<Ethan__Hunt> Hey, I am stuck at this:
<d_bot>
<Ethan__Hunt> I have to create Lookup_class which searches class 'c_name' in class environment 'c_env'. How to do that exactly?
<d_bot>
<Ethan__Hunt>
<d_bot>
<Ethan__Hunt> let lookup_class : string -> class_env -> class_decl ea_result = fun c_name c_env ->
<d_bot>
<NULL> - We have no idea what `class_env` and `class_decl ea_result` are supposed to be
<d_bot>
<NULL> - We do not do homework, we help answer questions
<d_bot>
<Ethan__Hunt> then what kind of questions are expected here?
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
<d_bot>
<NULL> Simplify your problem until you reach a smallest problem that you can't solve, at this point it should only refer to standard structures or a few specialised ones that you would introduce
<d_bot>
<Ethan__Hunt> I just want to know exact how to search?
<d_bot>
<NULL> "How to search" ? search what ?
<d_bot>
<Ethan__Hunt> class name in class environment
Soni has joined #ocaml
<d_bot>
<Ethan__Hunt> I am new to this language
<d_bot>
<NULL> "Searching" completely depends on what `class_env` is, and I have no idea what it is
<d_bot>
<Ethan__Hunt> type class_env = ((string*class_decl) list)
gzj has joined #ocaml
GZJ0X_ has joined #ocaml
<d_bot>
<NULL> So you can simplify the problem down to : I have a string and I want to find it in my `(string * class_decl) list` to return the associated `class_decl`
<d_bot>
<Ethan__Hunt> yes
<d_bot>
<NULL> Now, how much do you know about programming with lists in a functional language (like OCaml) ?
<d_bot>
<Ethan__Hunt> As I said I am new, and just have 3 months of experience with this language
<d_bot>
<Ethan__Hunt> But I know List operations
GZJ0X_ has quit [Client Quit]
gzj has quit [Ping timeout: 256 seconds]
<d_bot>
<NULL> What do you mean with "List operations" ? Is it about familiarity with the `List` module from `Stdlib` or familiarity with how to construct functions on lists with recursivity
<d_bot>
<Ethan__Hunt> Ya I know little of List
<d_bot>
<NULL> That doesn't answer my question
<d_bot>
<Ethan__Hunt> thank you for your time NULL, I guess I have to do it on my own without seeking help
<d_bot>
<Et7f3> No you can ask
<d_bot>
<Et7f3> If I give you: `(string * class_decl)` and a name can you say: yes it is the element I want or no give me another one
<d_bot>
<Et7f3> (just yes/no)
<d_bot>
<NULL> Sorry if I'm being too blunt, surely other people here can help you while being nicer
<d_bot>
<Et7f3> @Ethan__Hunt
<d_bot>
<Ethan__Hunt> Yes
<d_bot>
<Et7f3> Ok do you know how to access each item of a list
<d_bot>
<Ethan__Hunt> by Matching?
<d_bot>
<Et7f3> for instance
<d_bot>
<Et7f3> You see here you want to search a item in a container (list) I first asked if you know how to detect it is the item you want: One sub problem, I then asked if you know how to access item of that container it is again another sub problem
Tuplanolla has quit [Quit: Leaving.]
<Corbin>
Is the question just for List.assoc_opt or is there something else going on?
<d_bot>
<NULL> A deeper understanding of how the function works and how one would implement it on one's own
<d_bot>
<darrenldl> i think Et7f3's direction is the best bet for starting with this, and usually the approach used when teaching
<d_bot>
<darrenldl>
<d_bot>
<darrenldl> i'll add that leaving too much room for gues sing often makes it difficult for people to answer your question, or want to answer your question (we're not tutors of your course and have very little context as to what's going on)
Techcable has joined #ocaml
gravicappa has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Haudegen has joined #ocaml
wwilly_ has quit [Quit: Leaving]
zebrag has quit [Quit: Konversation terminated!]
Haudegen has quit [*.net *.split]
bgs has quit [*.net *.split]
Serpent7776 has quit [*.net *.split]
Guest9898 has quit [*.net *.split]
kurfen_ has quit [*.net *.split]
gdd has quit [*.net *.split]
andreypopp has quit [*.net *.split]
jakzale has quit [*.net *.split]
slothby has quit [*.net *.split]
Enjolras has quit [*.net *.split]
lobo has quit [*.net *.split]
b0o has quit [*.net *.split]
Boarders_ has quit [*.net *.split]
JSharp has quit [*.net *.split]
Fardale has quit [*.net *.split]
cbarrett has quit [*.net *.split]
Techcable has quit [*.net *.split]
jonasbits has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
Corbin has quit [*.net *.split]
rwmjones has quit [*.net *.split]
kakadu has quit [*.net *.split]
ansiwen has quit [*.net *.split]
kandu has quit [*.net *.split]
greyrat_ has quit [*.net *.split]
p4bl0 has quit [*.net *.split]
asm has quit [*.net *.split]
engil1 has quit [*.net *.split]
terrorjack has quit [*.net *.split]
sagax has quit [*.net *.split]
Soni has quit [*.net *.split]
shawn has quit [*.net *.split]
unyu has quit [*.net *.split]
riverdc has quit [*.net *.split]
ralu has quit [*.net *.split]
infinity0 has quit [*.net *.split]
micro has quit [*.net *.split]
jyc has quit [*.net *.split]
bacam has quit [*.net *.split]
omni has quit [*.net *.split]
Drup has quit [*.net *.split]
nyuhu has quit [*.net *.split]
Cypi has quit [*.net *.split]
xand0 has quit [*.net *.split]
Ekho has quit [*.net *.split]
caasih has quit [*.net *.split]
xenu has quit [*.net *.split]
welterde has quit [*.net *.split]
leah2 has quit [*.net *.split]
Putonlalla has quit [*.net *.split]
energizer has quit [*.net *.split]
Chouhartem has quit [*.net *.split]
adrien has quit [*.net *.split]
cross has quit [*.net *.split]
terrorjack has joined #ocaml
bgs has joined #ocaml
unyu has joined #ocaml
Serpent7776 has joined #ocaml
Corbin has joined #ocaml
Guest9898 has joined #ocaml
rwmjones has joined #ocaml
kurfen_ has joined #ocaml
andreypopp has joined #ocaml
gdd has joined #ocaml
slothby has joined #ocaml
jakzale has joined #ocaml
b0o has joined #ocaml
Enjolras has joined #ocaml
lobo has joined #ocaml
kakadu has joined #ocaml
kandu has joined #ocaml
ansiwen has joined #ocaml
ralu has joined #ocaml
riverdc has joined #ocaml
jyc has joined #ocaml
infinity0 has joined #ocaml
greyrat_ has joined #ocaml
micro has joined #ocaml
Fardale has joined #ocaml
cbarrett has joined #ocaml
JSharp has joined #ocaml
omni has joined #ocaml
Boarders_ has joined #ocaml
bacam has joined #ocaml
nyuhu has joined #ocaml
Drup has joined #ocaml
Cypi has joined #ocaml
xand0 has joined #ocaml
Ekho has joined #ocaml
caasih has joined #ocaml
shawn has joined #ocaml
xenu has joined #ocaml
Techcable has joined #ocaml
p4bl0 has joined #ocaml
Soni has joined #ocaml
sagax has joined #ocaml
grobe0ba has joined #ocaml
jonasbits has joined #ocaml
Haudegen has joined #ocaml
leah2 has joined #ocaml
welterde has joined #ocaml
engil1 has joined #ocaml
Putonlalla has joined #ocaml
Chouhartem has joined #ocaml
asm has joined #ocaml
energizer has joined #ocaml
adrien has joined #ocaml
cross has joined #ocaml
d_bot has quit [Excess Flood]
Exa has quit [Max SendQ exceeded]
Exa has joined #ocaml
d_bot has joined #ocaml
Absalom7 has joined #ocaml
Colt has quit [Remote host closed the connection]
Absalom has quit [Ping timeout: 256 seconds]
Absalom7 is now known as Absalom
Colt has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SquidDev has quit [*.net *.split]
drewolson has quit [*.net *.split]
notnotdan has quit [*.net *.split]
daimrod2 has quit [*.net *.split]
theblatte has quit [*.net *.split]
mg has quit [*.net *.split]
theblatte has joined #ocaml
mg has joined #ocaml
drewolson has joined #ocaml
daimrod2 has joined #ocaml
notnotdan has joined #ocaml
mg has quit [Changing host]
mg has joined #ocaml
SquidDev has joined #ocaml
_whitelogger has joined #ocaml
thizanne has joined #ocaml
oisota has joined #ocaml
nore has joined #ocaml
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
salkin has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
Goldstein has joined #ocaml
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
gahr_ is now known as gahr
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
ebb has quit [Max SendQ exceeded]
ebb has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Goldstein has quit [Remote host closed the connection]
Goldstein has joined #ocaml
gahr has quit [Quit: leaving]
gahr has joined #ocaml
mro has joined #ocaml
Goldstein has quit [Ping timeout: 240 seconds]
<Armael>
/w 9
<Armael>
ach
mro_ has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
Tuplanolla has joined #ocaml
bartholin has joined #ocaml
<d_bot>
<Lupus> so... I have an issue in one environment, ocamlfind can't find threads
<d_bot>
<Lupus> exactly the same docker launches yield different results, in the problematic environment it complains about threads, in other environments it works just fine, I'm totally confused on how that's possible, docker was supposed to offer reproducible builds after all 😂
<d_bot>
<NULL> Considering the language of PS and your kinda broken English, do you think it would be easier to go to #débutants ?
<d_bot>
<antron> @Tsukishima but in the meantime, the correct extension to use for ocaml right now is usually OCaml Platform, not OCaml and Reason IDE
<d_bot>
<Tsukishima> Haha okay sorry
<d_bot>
<antron> and it looks like you are working directly on windows, so you'll need to install ocaml on windows (separately from the extension, the extension will just discover your ocaml install)
<d_bot>
<NULL> Don't be sorry, I figured you'd have a harder time writing English than me understanding it, and we're both French-speakers
<d_bot>
<Tsukishima> i have installed ocaml on my computer as well
<d_bot>
<NULL> Looks like you either didn't install opam or it's not in the Path, considering what PS says
<d_bot>
<antron> actually looking again, you did say you installed ubuntu (assuming you mean WSL?)
<d_bot>
<antron> do you want to use ocaml on windows, inside WSL, or otherwise?
<d_bot>
<Tsukishima> I want to use Ocaml haha I tried everything I found on internet so I installed Ocaml and Ubuntu
<d_bot>
<antron> ok probably better to stick with windows then
<d_bot>
<Tsukishima> How can I do that ?
<d_bot>
<antron> what did you do to install ocaml?
<d_bot>
<NULL> Regarding installation on Windows, I know pretty much nothing so @antron will help you more
Haudegen has joined #ocaml
<d_bot>
<Tsukishima> I installed the extension on Vscode which as you say is not the right one and besides does not work. then i installed Ocaml except I couldn't get to the directory that I needed so I tried on the Vscode terminal and the Ocaml commands didn't work. then I install the Ubuntu virtual machine except that it gives me an error after they ask me to install WSL and finally I directly install the Ubuntu operating system to see if it w
<d_bot>
<antron> can you say what you mean, specifically by,
<d_bot>
<antron> > then i installed Ocaml
<d_bot>
<Tsukishima> I installed Ocaml with the website
<d_bot>
<antron> "i went to website XYZ and followed instructions ABC or downloded IJK"
<d_bot>
<antron> specifically
<d_bot>
<NULL> > except I couldn't get to the directory that I needed
<d_bot>
<NULL> I imagine nothing meaningful happened in any case
<d_bot>
<Tsukishima> I went to Ocaml.org -> installer Ocaml -> windows -> Graphical Installer
<d_bot>
<Tsukishima> Can I send you my projet so you can see what its look like ?
<d_bot>
<antron> snatx: there is no guarantee that in `f2 () + l1 ()`, `f2 ()` will be evaluated first. the compiler can choose to have the recursive `l1 ()` evaluated first
<d_bot>
<NULL> Missed that
<d_bot>
<antron> if you want to force the order, use a binding, `let some_variable = f2 () in some_variable + l1 ()`
<snatx>
antron: thanks!
<d_bot>
<NULL> d_bot stands for "discord bot", the person that answered is antron
<d_bot>
<antron> you can make a gist but i dont see a need for it now
<d_bot>
<antron> after installing `ocaml-lsp-server` in the terminal, and OCaml Platform extension in vscode, what is happening in vscode?
<d_bot>
<Kakadu> You can try to compile to bytecode and run
<d_bot>
<Kakadu> Also, you can adjust default stack size
<d_bot>
<zakkor> how should I do this using dune?
<d_bot>
<Kakadu> There is something about it on the docs
<d_bot>
<zakkor> ah, I see
<d_bot>
<zakkor> yeah, that helped, it's a stack overflow
<d_bot>
<Kakadu> Sometimes it is difficult to distinguish segfault from proper stack overlfow
<d_bot>
<Kakadu> It got difficulties with while presenting motivation for CPS for my students
<d_bot>
<Kakadu> with it*
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Guest4 has joined #ocaml
Guest4 has quit [Client Quit]
zebrag has joined #ocaml
rgrinberg has joined #ocaml
xiongxin has quit [Remote host closed the connection]
gahr has quit [Quit: leaving]
gahr has joined #ocaml
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mbuf has quit [Quit: Leaving]
bartholin has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
chrisz has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
cedric has joined #ocaml
<Anarchos>
Hello, i noticed that on my platform (haiku-os), i have two tests of the compiler suite that failed on unix : they are tests on bind on local sockets. Those sockets are created as PF_UNIX/SOCK_DGRAM, but on Haiku, we have only PF_UNIX/SOCK_STREAM for local sockets.
<Anarchos>
if i had a test on the platform to select this path, will it have a chance to be accepted in the official testsuite ?
<Anarchos>
s/had/add/
<d_bot>
<antron> are there any existing PF_UNIX SOCK_STREAM tests?
mro has quit [Remote host closed the connection]
<Anarchos>
Anarchos my goals is this test to pass :
<Anarchos>
let s = Unix.socket PF_UNIX SOCK_DGRAM 0 in
<Anarchos>
as i have no sock_dgram for pf_unix as i said
mro has joined #ocaml
<d_bot>
<antron> i understood what you said about not having SOCK_DGRAM. you separately also said that you want to "add a test on the platform to select this path." does this mean you want to add a new test, or something else?
<Anarchos>
Anarchos i think i should transform the bind test on the datagram socket to a connect test on the datagram local socket ?
<Anarchos>
on the stream local socket, sorry
<d_bot>
<antron> if you unconditionally transform it, i dont think it would be accepted, as recvfrom is typically used for SOCK_DGRAM sockets
<d_bot>
<antron> if you can make it conditional on whether the platform supports SOCK_DGRAM or not then perhaps
<d_bot>
<antron> that is my guess
<Anarchos>
antron i noticed plenty of tests are conditional on the platform, so i will try that. thanks for the advice
<d_bot>
<antron> i havent looked into it, but it looks like it should probably interact with the configure script, probably with a check for support for SOCK_DGRAM specifically
<d_bot>
<antron> that is correct, it can be, but it is typically used for SOCK_DGRAM sockets
<d_bot>
<antron> because it is (almost fully) redundant for SOCK_STREAM sockets
<d_bot>
<antron> or more correctly, it's typically used for sockets other than SOCK_STREAM sockets
<Anarchos>
Anarchos i will try to duplicate the test , transform the socket into sock_stream, and look what happens :)
haesbaert has quit [Remote host closed the connection]
waleee has joined #ocaml
sagax has quit [Remote host closed the connection]
chrisz has quit [Quit: leaving]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
<d_bot>
<JJam> not sure if this is the right place to ask; is there an easier way to create json strings than what i'm doing right now - I use a string literal {||} with sprintf and then use Yojson.Basic.from_string & to_string. there's gotta be an easier way, right?
<companion_cube>
if you already have a string that is valid json… why not use it? :)
<companion_cube>
although if you want to create a json with arbitrary values inside
<companion_cube>
you could use the yojson type constructors?
<d_bot>
<JJam> thank you! that certainly makes things less complicated
<companion_cube>
indeed!
bmo has joined #ocaml
sagax has joined #ocaml
<d_bot>
<Continuation Calculus> hi
<d_bot>
<Continuation Calculus> by any chance, any way to get the stdoutput of a Sys.command call in OCaml that is portable and does not require creating an intermediary file?
<companion_cube>
you need to use Unix.open_process_in iirc
<d_bot>
<Continuation Calculus> Unix doesn't seem very portable
<d_bot>
<Continuation Calculus> it actually is
<d_bot>
<Continuation Calculus> what a misnomer
<companion_cube>
it works on posix systems, mostly
<companion_cube>
won't work on javascript, but well, neither will processes
<d_bot>
<jumpnbrownweasel> I was confused about that also, but since I saw Windows code in a Unix .ml file, I figured it was perhaps originally unix and then made more portable over time?
<companion_cube>
I don't know about the history
<companion_cube>
but parts of Unix are supported on windows
<companion_cube>
some functions are not
<companion_cube>
I think the open_process functions are.
Techcable has quit [Ping timeout: 256 seconds]
<d_bot>
<Continuation Calculus> `The command is interpreted by the shell /bin/sh (or cmd.exe on Windows)`
<d_bot>
<Et7f3> It provides API we encounter on unix. This is how I see it. And polyfill as much as possible. I.e. fork doesn't work but the rest is fine.
<d_bot>
<Et7f3> Nodejs can create process 👀 so it seems possible to bind it
mro has quit [Quit: Leaving...]
<companion_cube>
there's stuff to create processes already
<companion_cube>
but also, yes, `luv` exists (bindings to libuv)
<d_bot>
<Continuation Calculus> hmmm.. i want to run js in ocaml (to check that the compiler from my lang to js works), but each run takes .120s, which makes running all my tests really slow. currently, i just use `open_process_in`, `input_line` repeatedly and then `close_process_in`. any faster way of doing that? (or should I just start batching all the tests in a single file? ~~but then i loose my neat alcotest colors~~)
<companion_cube>
doesn't alcotest parallelize? if not, might be difficult
<d_bot>
<Continuation Calculus> ooo, good q, i might gain stuff there
<d_bot>
<Continuation Calculus> nothing on readme.md
rgrinberg has quit [Ping timeout: 252 seconds]
<d_bot>
<Continuation Calculus> ye it doesn't, np, i'll just batch
<companion_cube>
that's a pity
<companion_cube>
alcotest came around when ounit already existed, and ounit2 can parallelize
<companion_cube>
alcotest became popular because of its colorful UI
<companion_cube>
:/
<d_bot>
<Continuation Calculus> i was going to ask if ounit2 had colors
<companion_cube>
a little bit I think, with the `-ci` mode or whatever
<companion_cube>
it's not as pretty
<companion_cube>
but I'm a bit sad alcotest wasn't just a nice runner for ounit
<d_bot>
<Continuation Calculus> i'll try ounit
<d_bot>
<Continuation Calculus> i hope it displays the time taken to run the tests
<companion_cube>
I don't recall, honestly
<Anarchos>
companion_cube i ought to use ounit2 for my tests, and bisect_ppx for the coverage/nice html results
<companion_cube>
sure
<companion_cube>
ounit also outputs junit results if you need them, for example
<companion_cube>
that was nice in combination with jenkins
<Anarchos>
companion_cube i hate java,jenkins and so on, i am fed up with all those j2ee bulllsh*t at work when i tastes the beauty of ocaml since 'classes préparatoires'