keen____ has quit [Read error: Connection reset by peer]
t4nk394 has joined #ocaml
<t4nk394>
let x = 10 ;;
<t4nk394>
let x = 20 ;;
<t4nk394>
How is 'x' considered immutable if i can redefine it like above
<t4nk394>
newb question sorry
abbe has quit [Read error: Connection reset by peer]
abbe has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest35720
mcclurmc_ has joined #ocaml
<haesbaert>
ahA, seems I'm finally getting the hang of it
Guest35720 has quit [Ping timeout: 256 seconds]
<tokenrove>
t4nk394: the old x is shadowed. if you have a function in between that uses x, it will always use the old value of x.
mcclurmc has quit [Ping timeout: 264 seconds]
<t4nk394>
tokenrove, i don't get it
<t4nk394>
# let x = 10 ;; val x : int = 10 # let x = 20 ;; val x : int = 20 # let y = x + 1 ;; val y : int = 21 #
<t4nk394>
y is getting the new value of x above
<tokenrove>
yes, but if you defined y in between, it would have the old value. it's more clear if you have a function. let's say you want x to act like a global variable for the position of something, and have a function redraw that draws an object using x as the position.
<tokenrove>
you call redraw, and then you say let x = x + 10;; and call redraw again. but your object doesn't move.
<tokenrove>
you have defined a new x for all the code that follows; you haven't changed the old x.
jbrown has quit [Ping timeout: 244 seconds]
<t4nk394>
thank you tokenrove
<t4nk394>
i will test your theory in utop
mcclurmc has joined #ocaml
mcclurmc_ has quit [Ping timeout: 272 seconds]
gperetin has quit [Ping timeout: 276 seconds]
swgillespie has joined #ocaml
gperetin has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
jbrown has joined #ocaml
rgrinberg has quit [Ping timeout: 255 seconds]
kushal has joined #ocaml
t4nk394 has quit [Ping timeout: 246 seconds]
Tekilla has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
nullcat_ has joined #ocaml
WraithM has quit [Quit: leaving]
AltGr has joined #ocaml
struktured has joined #ocaml
ollehar has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
The_Mad_Pirate has joined #ocaml
ollehar has quit [Quit: ollehar]
cross has joined #ocaml
<mcc>
Hm.
<mcc>
I just found a typographical error in the Caml Light manual.
<mcc>
Is... .... nobody cares in this decade, do they
<struktured>
doesn't hurt to send an email or something I guess..
BitPuffin has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
Ayyy has joined #ocaml
<struktured>
the "pow" function, f(x,y)=x^y does not exist in ocaml stdlib right?
ygrek has joined #ocaml
Ayyy has left #ocaml [#ocaml]
cesar_ has joined #ocaml
cesar_ is now known as Guest31057
Guest31057 has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Ping timeout: 248 seconds]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcat_ has joined #ocaml
rgrinberg has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
darkf has joined #ocaml
dysfunc-pyon-al has quit [Ping timeout: 252 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
<cojy_>
is there any way to check for uncaught exceptions at compile time?
dysfunc-pyon-al has joined #ocaml
Algebr has joined #ocaml
<tokenrove>
struktured: it does exist for complex and num
<tokenrove>
oh, and of course ** is pow for floats.
<Algebr>
Drup: I have a strange issue with ocisgen, hoping you're on.
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 255 seconds]
c74d has quit [Read error: Connection reset by peer]
idegen has quit [Ping timeout: 250 seconds]
c74d has joined #ocaml
kushal has quit [Ping timeout: 248 seconds]
seanmcl has joined #ocaml
seanmcl has quit [Ping timeout: 244 seconds]
dysfunc-pyon-al has quit [Quit: My morality has evaporated under the harsh UV light.]
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
<struktured>
tokenrove: thanks..is it typical to whip up your own over floats directly or depend on the num module insteaad?
moei has quit [Read error: Connection reset by peer]
<struktured>
tokenrove: oh crap ** is pow? lol forgot
moei has joined #ocaml
<struktured>
tokenrove: thanks a bunch
<struktured>
cojy_: not that I know of, since exn is an open sum type its inherently uncheckable unless each function signature has a strict scoping defined
cesar_ has joined #ocaml
cesar_ is now known as Guest44807
Guest44807 has quit [Ping timeout: 250 seconds]
ygrek has quit [Ping timeout: 248 seconds]
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
blech__ has joined #ocaml
blech_ has quit [Ping timeout: 244 seconds]
mcclurmc has joined #ocaml
mcclurmc_ has quit [Ping timeout: 264 seconds]
blech__ has left #ocaml ["Leaving"]
seliopou has quit [Ping timeout: 264 seconds]
seanmcl has joined #ocaml
destrius has joined #ocaml
ggole has joined #ocaml
<destrius>
is there a standard function in Core that does a map and a fold at the same time? like one with type 'a list -> ~(init: 'accum) -> ~(f: 'accum -> 'a -> 'accum * 'b) -> 'accum * 'b list
<destrius>
and ideally one for Map
<destrius>
i know it can be done using just fold, but it's a little more inconvenient
lewis1711 has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
<struktured>
not that I can see in Core, but containers if you're willing to use it has scan aka fold_map
<AltGr>
cojy_, there is work on the subject, see for example François Pessaux's thesis, but it's related to abstract interpretation and I don't think there is anything readily usable at the moment
Algebr has quit [Ping timeout: 244 seconds]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
MercurialAlchemi has joined #ocaml
<ggole>
destrius: destructuring should make that pretty easy with fold_right
cesar_ has joined #ocaml
cesar_ is now known as Guest73854
Sorella has quit [Quit: Connection closed for inactivity]
Guest73854 has quit [Ping timeout: 265 seconds]
keen_____ has quit [Read error: Connection reset by peer]
keen_ has joined #ocaml
ollehar has joined #ocaml
<lewis1711>
is a crossplatform commandline app in ocaml feasible? I mean I am only testing it in linux. is it a huge amount of pain that will require cygwin?
keen_ has quit [Read error: Connection reset by peer]
keen_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
marynate has joined #ocaml
matason has joined #ocaml
mietek has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
psy_ has quit [Ping timeout: 250 seconds]
pyon has joined #ocaml
<mietek>
Anyone interested in the history of total functional programming languages?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlexRussia has quit [Quit: WeeChat 1.2-dev]
cesar_ has joined #ocaml
cesar_ is now known as Guest93460
Guest93460 has quit [Ping timeout: 252 seconds]
AlexRussia has joined #ocaml
<apache2>
struktured: ^ is usually xor (when dealing with programming languages)
<dmbaturin>
For the record, in pascal ^ is pointer dereference. :)
<dmbaturin>
(And it's unary there)
<def`>
(And postfix)
<ygrek>
^ is return in smalltalk
* ygrek
wonders how much sense carries the word "usually" when dealing with programming languages
ollehar has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
<zump>
I'm going crazy figuring out why this doesnt work. http://pastebin.com/jFMT5R53. The error is "This expression has type int but an exrepssion was expected of type Core.Std.String.t = string"
<zump>
Can anyone help
<dmbaturin>
Which exact expression?
<zump>
(Caml.List.length ins_list)
<zump>
dmbaturin:
<ggole>
Hard to say without seeing the data type that defines Instr
<dmbaturin>
Yeah, trim doesn't remove _all redundant whitespace_.
<dmbaturin>
It's not supposed to.
<ggole>
If you want something to squeeze whitespace, you'll have to implement that yourself or find a library
<dmbaturin>
It's easy to implement, but the notion of redundant whitespace is different for different tasks, so I doubt a one size fits all function can exist.
seanmcl has quit [Read error: Connection reset by peer]
Guest94477 has quit [Ping timeout: 245 seconds]
swgillespie has joined #ocaml
claudiuc has quit [Remote host closed the connection]
<adrien>
Meths: what does that do:
<adrien>
cloning /home/jt/projects/ec-userland/ec-userland/components/ocaml/source/ocaml-4.02.1 to /home/jt/projects/ec-userland/ec-userland/components/ocaml/build/i86
<adrien>
?
<adrien>
if there are symlinks or hardlinks involved, it's probably the issue
claudiuc has joined #ocaml
<adrien>
(actually it looks very probable)
<Meths>
That's the cloning the source to the build dir. You don't support out of tree builds very well.
<Meths>
Okay, let me replace that with an rsync and double check.
<Meths>
I'll run the 64bit configure line in a untarred source too to confirm.
matason_ has joined #ocaml
Haudegen has quit [Ping timeout: 248 seconds]
<adrien>
"very well", that's an euphemism :)
matason has quit [Ping timeout: 264 seconds]
<Meths>
adrien: Do you use the env variables CC/CXX at all?
<adrien>
Meths: no, it's done through ./configure -cc gcc
<adrien>
open configure in a text editor, scroll to line 85 and you'll see the list of possible options
<adrien>
(yes, it's primitive but so far it's been too much work to change it=)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Meths>
I've seen them, that's what I thought but just wanted to check as I just noticed they're mismatched.
<Meths>
(The -cc was correct.)
swgillespie has joined #ocaml
matason_ has quit [Quit: Leaving...]
Nijikokun has joined #ocaml
Nijikokun has quit [Max SendQ exceeded]
axiles has joined #ocaml
Nijikokun has joined #ocaml
Nijikokun has quit [Max SendQ exceeded]
Haudegen has joined #ocaml
c355E3B has joined #ocaml
_andre has quit [Quit: leaving]
matason has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
kakadu has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
kdef has quit [Ping timeout: 272 seconds]
kdef has joined #ocaml
matason has joined #ocaml
lanii has quit [Ping timeout: 244 seconds]
yomimono has joined #ocaml
rgrinberg has joined #ocaml
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
troydm has joined #ocaml
troydm has quit [Client Quit]
troydm has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
<adrien>
trying something on openbsd
troydm has quit [Client Quit]
<adrien>
installing git through ports
<adrien>
it installs gmake
<adrien>
it was a sane move from Xavier Leroy to want to stop bothering about non gnu makes probably
<Meths>
adrien: Same thing, I told it to do two untars instead of any type of cloning at all. I also tried a standalone directory and just fed it 64 bit configure parameters.
troydm has joined #ocaml
<Meths>
Is the partial linking parameter listed in the configure output?
<adrien>
doesn't look like it is
c355E3B has quit [Quit: Leaving]
<adrien>
you might want to check config/Makefile in both builds
<Meths>
the partial ld in those Makefiles looked wrong, both as it was using a relative path which would give it the wrong linker and there was no bitness. Trying with a better parameter now...
rgrinberg has joined #ocaml
xificurC has joined #ocaml
WraithM has quit [Quit: leaving]
ggole has quit [Ping timeout: 250 seconds]
<Meths>
Success.
<adrien>
\o/
mengu has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
MrScout has quit [Ping timeout: 245 seconds]
MrScout_ has joined #ocaml
agarie has quit [Remote host closed the connection]
xificurC has quit [Remote host closed the connection]
agarie has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
axiles has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MercurialAlchemi has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest38630
swgillespie has joined #ocaml
Guest38630 has quit [Ping timeout: 245 seconds]
bjorkintosh has quit [Quit: Leaving]
bjorkintosh has joined #ocaml
mengu has quit [Remote host closed the connection]
<SGrondin>
<-- the guy who taught him the basics yesterday. I was surprised at how fast he learned it. I take the blame for suggesting a match instead of an if
<Drup>
you should probably document (and change the name) of the "a" argument :p
<Nijikokun>
it went from core -> no core w/ algorithm -> no core w/ loop
moei has quit [Quit: Leaving...]
<Drup>
Funilly, I would have done the other way around
<SGrondin>
I kept telling him that single letter arguments shouldn't be used used outside of one liners but noooo :P
MrScout_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
<Drup>
precompute the size of each prefix in an array or a list and test again those.
<Nijikokun>
it felt more obscure and made everything feel right, I get your point about documenting it and probably changing it though drup
<Drup>
instead of iteratively dividing
<Drup>
but that's details
<Nijikokun>
true, was trying to do the basics first, totally right though
<Drup>
rgrinberg: back to ocsigenserver testing.
<rgrinberg>
Drup: cool. any concrete bugs yet?
<Drup>
(I felt like doing a break today, so I ended up playing with gadt ... yes I know)
<rgrinberg>
Drup: I made a test for the empty chunk truncation stuff in cohttp and I can't reproduce :O
<rgrinberg>
Drup: haha gadt's soothe the soul
seanmcl has joined #ocaml
<Drup>
yeah, but I can't find a way to do what I want
<Drup>
(I'm trying to do the equivalent of De bruijn indexes, but for tree of arithmetic expressions, so I need to append the list of holes at a point, and can't find a way to do that)
<Drup>
rgrinberg: with dinosaure's fix for it, it goes slightly further
<Drup>
but eliom's test are still broken
walt is now known as ggVGc
<Drup>
ocsigenserver: ocsigen:ext: site "miniwiki" does not match url "/localhost%3A8080/miniwiki".
<Drup>
fail.
seanmcl has quit [Ping timeout: 252 seconds]
Submarine has quit [Quit: Leaving]
<Drup>
rgrinberg: if I want printers for the various cohttp types, were do I look ?
seanmcl has joined #ocaml
<rgrinberg>
Drup: sexplib
<Drup>
grrr
<rgrinberg>
Yeah, we do want to improve that
<rgrinberg>
kind of hard though without breaking everyone
<Drup>
simple, add a to_string and a pp function, doesn't break anyone
<rgrinberg>
you mean add 39823 to_string functions
<Drup>
ah yes, sure, ppx.deriving show
<rgrinberg>
But ppx doesn't work with camlp4 :/
<Drup>
I know ...
<rgrinberg>
Well more like camlp4 doesn't work with ppx
<smondet>
Drup: it breaks for people who use the to_sexp functions :) (I do, but I would be happy to change my code when Cohttp gets rid of Camlp4)
<Drup>
smondet: I mean, without removing the sexp functions
<Drup>
which will happen, since core is working on ppxing core
<Drup>
jst*
<rgrinberg>
Drup: hopefully we can piggy back on that effort
<rgrinberg>
cohttp will drop 4.01 altogether once the next version of OCaml is released probably
<Drup>
that's cool
<Drup>
it means I can drop 4.01 in eliom too :D
<rgrinberg>
Drup: so for now we have to be in this camlp4 type conv limbo unfortunately
<Drup>
I know
<rgrinberg>
You can still debug cohttp effectively though so it's not so bad
<Drup>
well, anyway, it'll be sexp for now
<companion_cube>
is of_sexp actually used in cohtp?
<rgrinberg>
companion_cube: not really
rwmjones_hol has quit [Read error: Network is unreachable]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
rwmjones_hol has joined #ocaml
tane has quit [Quit: Verlassend]
Gama11_ has quit [Read error: Connection reset by peer]
seangrove has quit [Ping timeout: 245 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 272 seconds]
govg has joined #ocaml
kushal has quit [Ping timeout: 265 seconds]
matason has quit [Quit: Leaving...]
SGrondin has quit [Quit: Leaving.]
SGrondin has joined #ocaml
<Drup>
dinosaure: programming tips
<Drup>
when you are doing copy/paste more than once, something is wrong and you should think about it
lobo has quit [Quit: leaving]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<rgrinberg>
Drup: what's he copy pasting?
<Drup>
I'll show you the patch, you'll facepalm
<dmbaturin>
Sometimes boilerplate is unavoidable though.
<Drup>
in this case, it was
<Drup>
really
<dmbaturin>
Drup: I'm still to see the code in question so I'm just making a mostly correct statements for the sake of it. :)
<Drup>
ocsigenserver: ocsigen:ext: host = localhost:8080 does not match 127.0.0.1
<rgrinberg>
Drup: and yep, uri does everything eagerly it's obnoxious
<rgrinberg>
brb in an hour
seanmcl has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
MrScout has joined #ocaml
jwatzman|work has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
natrium1970 has joined #ocaml
madroach has joined #ocaml
Nijikokun has quit [Ping timeout: 252 seconds]
<natrium1970>
I am confused about the statement in the OCaml refman that “The use of #t-types to abbreviate polymorphic variant types is deprecated.” Is that statement talking about something different from “let f = function #myvariant -> “myvariant” | `Tag3 -> “Tag3” ?
olibjerd has quit [Ping timeout: 250 seconds]
<natrium1970>
(myvariant is defined as type myvariant = [`Tag1 of int | `Tag2 of bool])
MrScout has quit [Read error: Connection reset by peer]
<Drup>
yes
MrScout has joined #ocaml
<Drup>
It's the use of #foo instead of [< foo] that is deprecated
<Drup>
the use as a pattern is not
<natrium1970>
Just making sure. Thank you Drup
cesar_ has joined #ocaml
cesar_ is now known as Guest15848
<struktured>
oops I posted garbage in #math that that was meant for here lol
<natrium1970>
No one will notice.
<struktured>
thats exactly what happened
<SGrondin>
haha, they probably thought it was some math notation they hadn't encountered before