cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
<eu-prleu-peupeu> oi holo!
<eu-prleu-peupeu> do you code in ocaml ?
<eu-prleu-peupeu> i found out this language the other day, seems interesting :)
<holo> eu-prleu-peupeu, nao.. estou a usar caml light.. e' muito bom, mas e' parecido. mas usa ocaml :>
<holo> eu-prleu-peupeu, don't give up easily on ocaml!! it is very nice but if you are not used to declarative languages, it may seem weird
<holo> it produces very general, elegant and maintainable algorithms
<eu-prleu-peupeu> :D
<eu-prleu-peupeu> how about speed ?
<holo> dunno sorry
<eu-prleu-peupeu> :)
<holo> ha
<holo> lol
<holo> thought speed was a language
<holo> :x
<eu-prleu-peupeu> és português ?
<eu-prleu-peupeu> hehehe
<holo> yep
<holo> ua
<holo> ist ne?
<eu-prleu-peupeu> sweet, me too
<eu-prleu-peupeu> yeps
<eu-prleu-peupeu> i've been reading about ocaml, and found this on wikipedia:
<eu-prleu-peupeu> MetaOCaml[4] is a multi-stage programming extension of OCaml enabling incremental compiling of new machine code during runtime.
<eu-prleu-peupeu> this seems quite powerfull...
<eu-prleu-peupeu> this concept of "multi-stage programming"
<holo> ok.. resumindo: em linguagens imperativas tens de alocar explicitamente memoria, em linguagens funcionais como caml, a recursividade e' algo natural, e com recursividade crias as variaveis em cada chamada.. as variaveis existem como argumentos e retornos de funcoes, produzindo assim algoritmos muito generalistas
<eu-prleu-peupeu> have you seen this: http://en.wikipedia.org/wiki/Alice_programming_language ?
<holo> se ja programaste em C, .estas habituado a produzir variaveis dentro das funcoes tipo contadores, variaveis temporarias.. esquece esse codigo sujo em caml
<eu-prleu-peupeu> sim, estou a tentar evitar isso
<holo> :)
<eu-prleu-peupeu> acho algumas semelhanças com lisp e scheme, dos poucos exemplos que vi de ocaml
<holo> ve tambe haskell
<eu-prleu-peupeu> ah sim...
<holo> e' o que usam em lesi
<holo> dizem que e' potente
<eu-prleu-peupeu> o que é lesi ?
<holo> Licen. Eng. Sistemas e informatica
<eu-prleu-peupeu> ah okok :P
<holo> em braga
<eu-prleu-peupeu> very nice
<holo> ou entao escolhe a que tiver mais libs ;)
<holo> eu so tenho experiencia em caml
<eu-prleu-peupeu> hehehe, ou bindings para C :)
<eu-prleu-peupeu> caml é fixe para se aprender né ?
<holo> esquece isso.. quando lhe apanhares o gosto, vais esquecer o C
<holo> caml light e' fixe para aprender, ocaml e' mesmo usado para producao
<holo> Mas se queres aprender podes comecar a usar ocaml directamente
<holo> Eu so' estou a usar caml light porque a univ. me obriga
<eu-prleu-peupeu> eu estou muito ligado ao c++, mas sinto falta de algumas cenas, como lambdas, e reflecção
<holo> c++ e' uma heresia
<eu-prleu-peupeu> hehehe
<eu-prleu-peupeu> eu gosto bastante, é muito muito rápido se for bem feito
<holo> mas cada um tem os seus gostos
<eu-prleu-peupeu> claro :)
<eu-prleu-peupeu> acho que um gajo não pode viver agarrado a uma determinada linguagem
<eu-prleu-peupeu> sei lah, eh importante escolher uma que se ajuste ao problema em causa
<holo> Sim, rapidez e' bom, mas com prog. funcional consegues algoritmos muito rapidos (nao tao rapidos como c ou c++) mas o pensamento e' muito mais alto nivel
<holo> E a beleza duma linguagem e' isso mesmo
<eu-prleu-peupeu> ya, isso que me interessa
<eu-prleu-peupeu> conseguir obter um tempo de desenvolvimento muito maior, não sacrificando muito a velocidade, e a leitura/manutenção de código
<holo> entao escolheste bem o paradigma
<holo> depois de te habituares, os algoritmos de caml vao parecer extremamente legiveis e mantiveis
<holo> e com pouco codigo, vais fazer muita coisa
<eu-prleu-peupeu> :D
<eu-prleu-peupeu> very nice good
<eu-prleu-peupeu> entao tass bem
<eu-prleu-peupeu> vi que o ocaml tem bindings para o QT e para o openGL, e tb me atraiu
<eu-prleu-peupeu> a malta aqui tb anda a começar com a febre do haskell
<eu-prleu-peupeu> foi o lisp, depois mudou para o ruby, e agora é o haskell que está aí a infectar
<holo> exactamente.. vai por ai.. escolhe a que tem mais libs para os problemas que queres resolver
<Smerdyakov> Excuse me.
<Smerdyakov> This is an English channel!
<eu-prleu-peupeu> sorry
<holo> sorry
<eu-prleu-peupeu> lets switch to english
<eu-prleu-peupeu> we were just saying bad things about ocaml, and speaking of how much better C and C++ are compared to ocaml
<Smerdyakov> Neat.
<holo> xD
<mbishop> heh
<holo> eu-prleu-peupeu, i just have experience in c/c++,caml,prolog,python,pascal (ouch), matlab (yuck)
<holo> never tried lots of stupid and meaningless parenteses
<eu-prleu-peupeu> heheh :)
<eu-prleu-peupeu> i was also wondering about this: http://www.ps.uni-sb.de/alice/
<eu-prleu-peupeu> alice programming language
<holo> yes, i saw your link
<eu-prleu-peupeu> and the king of paradigms it has for multithreaded
<holo> alice is also a famous bot
<holo> i chick
<holo> *a chick
<eu-prleu-peupeu> heheh :)
<eu-prleu-peupeu> i like that, multithreaded crafted languages
<holo> does ruby still don't have multithreading?
<eu-prleu-peupeu> i dunno
<eu-prleu-peupeu> never touched ruby
<holo> oh.. i find several matches in google, it must have
<holo> i heard about that in an interview with guido van rossum, but it must have been a fake information
<esdee> you probably heard that it only has interpreter level threads, it doesn't use system threads
<eu-prleu-peupeu> i've recently heard about "behaviour driven development"
<eu-prleu-peupeu> but haven't dig into that
<eu-prleu-peupeu> the name sounds interesting
<eu-prleu-peupeu> there is this video on google videos
<holo> show it
<eu-prleu-peupeu> let me find it....
<eu-prleu-peupeu> its too long, i haven't managed to get time to watch it yet...
<holo> he should cut his "barba"
<holo> omg
<eu-prleu-peupeu> yes, looks like fidel castro
<eu-prleu-peupeu> a little fatter
<eu-prleu-peupeu> something like "fidel goes to usa..."
<holo> :>
<holo> the audience is very serious.. they don't lauph at all
<holo> oh.. they lauphed.. he said a bad word
<holo> "we wanna talk abut behavior"
<holo> so this is the canadian accent!!
<eu-prleu-peupeu> hehehe
mikeX has quit ["leaving"]
holo has quit ["This computer has gone to sleep"]
eu-prleu-peupeu has left #ocaml []
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
pantsd has quit ["Leaving."]
pantsd has joined #ocaml
Demitar has joined #ocaml
EliasAmaral has quit [Remote closed the connection]
Demitar has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
<pango_> In case he returns, one can match the empty stream with [<>]
<pango_> I guess he's getting a match failure, not End_of_file
G_ is now known as G
Smerdyakov has quit ["Leaving"]
ygrek has joined #ocaml
seafood has joined #ocaml
<seafood> Hi guys. A while back someone show me a cool VI OCaml keyboard short cut that would allow you to press a key and be taken from the "let" part of an expression to the corresponding "in" part, bypassing all nested lets.
<seafood> I don't use VI and was hoping there might be something familiar in one of the Emacs modes. Know of any?
kosmikus has quit [Read error: 104 (Connection reset by peer)]
kosmikus has joined #ocaml
<flux> hm, I haven't encountered one
<flux> I suppose tuareg mode could be hacked to do that, as it must for indentation purposes have the required information
Mr_Awesome has quit ["...and the Awesome level drops"]
Riesz has joined #ocaml
<mrvn> elisp is turing complete so surely you can do it somehow.
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<flux> I was thinking inthe sense "could be hacked without adding much more code" :)
<flux> syntax analysis being "much more code"..
<mrvn> that tuareg should already have
<seafood> Aren't most languages turing complete?
<mrvn> usefull ones.
<mrvn> A lot are unknown though
<flux> turing completeness needs not to be a requirement for a language to be useful, though.. there is some research on non-turing complete languages, which allow statically determining for example the amount of memory consumed, or time spent
<mrvn> not being able to write "let rec loop () = loop ()" is awfully limiting though. :)
<flux> well that's totally useless construct without side effects :)
<mrvn> flux: That is a wait forever
<mrvn> It is even partially correct for any given problem.
<mrvn> :)
<mrvn> partially correct == for all cases where it terminates it gives the right output
<flux> it would sometimes be nice if the compiler warned abut such constructs.. and infact the type inference process sometimes does that
<flux> return value being 'a instead of the expected..
<mrvn> right, I saw that recently for the first time.
<mrvn> But isn't that when a function will always return an exception?
<flux> no
<flux> well, it might not return at all :)
<flux> it's the same thing, sort of..
<mrvn> # let rec loop () = loop ();;
<mrvn> val loop : unit -> 'a = <fun>
<mrvn> no warning from the toplevel.
<mrvn> Doesn't seem to be very good at it then.
<mrvn> Maybe my ocaml is too old.
<flux> I sometimes inspect the types interactively
<flux> and I've actually spotted such a bug
<flux> (obviously a short test would've revealed it also..)
<mrvn> When my project gets big enough then I create mli files and then you spot it.
<mrvn> Isn't "-> 'a" when 'a is not part of the argument types always a endless loop (or Obj magic)?
<flux> actually I tried that, but this did catch it: module Foo : sig val loop : unit -> unit end = struct let rec loop () = loop () end;;
<flux> or an exception. yes, I believe so.
<mrvn> I wonder why exceptions aren't part of a functions tpye.
<flux> that would be an interesting experiment
<flux> with exception inference
<flux> it would mean, though, that you couldn't just put any throwing functions to a list of unit -> unit functions
<mrvn> val loop : unit -> unit * [< End_of_file ]
<flux> with java checked exceptions quickly become boring
<flux> but with a solid type system it might be manageable
<mrvn> unit -> unit * [< ] is subset of unit * [< End_of_file ]
<flux> (and type inference)
<flux> so what would be the type of List.fold_left?
<mrvn> C++ has this sort of. But it converts any exception not declared for the function to a generic exception.
<flux> and you can wrap around that and wrap it to your kind of exception
<flux> I've used that mechanism
<mrvn> flux: ('a -> 'b -> 'a * [< 'c ]) -> 'a -> 'b list -> 'a * [< 'c ] = <fun>
<flux> anyway, such an extension would not be backwards compatible with current programs
<flux> it's like adding 'const' to a language that doesn't have one..
<mrvn> I don't see that.
<mrvn> except for mli files
<flux> how do you mark functions that can throw anything?
<mrvn> But you could say that "unit -> unit" and "unit -> unit * [< ]" are two different things. The former can have any exception.
<mrvn> flux: [< 'a ]
<mrvn> But how would you ever throw anything?
<mrvn> That is the same as returning anything (which means it never does)
<flux> you could have a pair of functions, where one puts functions in and another calls them
<mrvn> Then you have an input argument with some exception type and you throw that same type.
<mrvn> See fold_left above.
<mrvn> That is an "throws whatever it is given"
<flux> module DoStuff = struct let f = ref (unit -> unit) let set_f f' = f := f' let call_f () = (!f) () end
<flux> uh, make that s/unit -> unit/fun () -> ()/
<mrvn> The mli file would say what exceptions are allowed for f and that type gets thrown by call_f.
<flux> yes, but you could have that module right now, and you have modules that use that module and they use locally defined exceptions
<mrvn> For compatibility "unit -> unit" should be the same as "unit -> unit * [< 'a ]" allowing any exception.
<flux> and anything calling call_f will also be infered to throw anything, unless they narrow it by catching _ - I think very similar to c++ constness :-)
<flux> (with const_cast)
<mrvn> Sure. You have to restrict the allowed exceptions to get any benefit from it.
<flux> it's a shame ocamlexn isn't maintained
<mrvn> The reason I would want this is so that I can make sure all exceptions are handled.
<mrvn> And often the manual doesn't say what exception a function can throw.
<flux> that problem has bitten me a few times
<mrvn> Another thing I would like would be for exception to have an implicit __FILE__ and __LINE__, at least optionally.
<mrvn> Just the other day my programm failed with Index out of bounds exception. Now try to find that.
z__z has quit [Read error: 60 (Operation timed out)]
ygrek has quit [Remote closed the connection]
<mrvn> Python exceptions are nice that way. They give you a backtrace.
ygrek_ has joined #ocaml
<flux> hm, ocamlc -g and export OCAMLRUNPARAM=b ?
<flux> but that particular exception might be more difficult to find; there is a module on caml hump (?) that provides more accurate tracing or something
<flux> I haven't used it
<mrvn> what does that do?
<flux> I don't know, but I'm guessing it wraps indexing etc with some other exception throwing code
<flux> or did you refer to ocamlc -g ?
<mrvn> -g
<flux> it compiles with debug information
<mrvn> No mention in the manpage
<mrvn> Not sure if -g helps.
<flux> and OCAMLRUNPARAM=b gives you back traces
<mrvn> OCAMLRUNPARAM=b would help though
<flux> well it doesn't work without -g
<mrvn> ahh, ok.
<mrvn> I usualy use ocamlopt though.
<flux> try the new release, it adds backtracing for native binaries
<mrvn> next time I run into the problem or when debian updates.
<mrvn> for now I like my stable.
Demitar has joined #ocaml
ygrek_ has quit [Remote closed the connection]
z__z has joined #ocaml
Demitar_ has joined #ocaml
Sparkles has joined #ocaml
holo has joined #ocaml
<holo> hi
<holo> i make a program that says print_string "hello world";; in camllight
<holo> then camlc -o test test.ml
<holo> ./test
<holo> and it prints nothing
<holo> weird is, i have a program of 335 lines and it prints things -.-
<flux> holo, ./test; echo ?
<holo> flux, that just prints a "\n"
<flux> yes, correct
<flux> one common newbie mistake is to output stuff but not output the newline
<flux> and the prompt erases the output
<flux> at it appears like it had output nothing
<flux> some shells handle that issue by outputting a special character and a newline in those cases
<holo> flux, it outputed the newline becouse you said "echo"
<flux> I've never used camllight so there might be some other issue too
<flux> maybe it doesn't flush output automatically on exit
Sparkles has quit []
<holo> print_endline "bla"
<holo> ;;
<holo> this one prints the newline
<holo> in theory
<holo> but it prints nothing
<holo> but if i use it in my 335 line program, it prints
<holo> i'm not messing with channel and stuff like that
<holo> *channels
<flux> such is life. the channel can be much more helpful with ocaml-related problems :)
Sparkles has joined #ocaml
<holo> :\
<holo> well.. this is weird anyway
<holo> it is not an explicit behavior
<holo> it should be explicit
<flux> perhaps a camllight-related FAQ could be of use?
<holo> maybe, let me see
G_ has joined #ocaml
rwmjones has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
joelr1 has joined #ocaml
<joelr1> rwmjones: hi rich
<rwmjones> joelr1, afternoon
<joelr1> well, so i'm trying to install cocan wiki first on my mac laptop and then on the solaris box i use for hosting
<rwmjones> adventurous ...
<joelr1> i'm curious, do i always have to supply the full path to the cma with CamlLoad?
<rwmjones> well, I think this channel is logged which is useful coz then people can find the answers to these questions via Google
<joelr1> right
<rwmjones> no, not with recent versions of mod_caml
<joelr1> hmm
<rwmjones> does it work?
<rwmjones> CamlLoad calendar/calendar.cma ?
<joelr1> so how would mod_caml know about ...
<joelr1> let me see, one sec
<rwmjones> (* CamlLoad [filename]. Preprend the ocaml standard library path
<rwmjones> (ocamlc -where) if [filename] is relative. *)
<rwmjones> let cmd_load filename =
<rwmjones> let filename =
<rwmjones> if Filename.is_relative filename then
<rwmjones> Filename.concat ocamllibdir filename
<rwmjones> else filename in
<rwmjones> reg_module_name := Some(String.capitalize(Filename.chop_extension
<rwmjones> (Filename.basename filename)));
<rwmjones> try Dynlink.loadfile filename;
<rwmjones> with Dynlink.Error (e) -> failwith (Dynlink.error_message e)
<rwmjones> it's the "if Filename.is_relative ..." bit
<joelr1> how would it know about my site-lib?
<joelr1> that's where ocamfind puts stuff
<rwmjones> it probably wouldn't
<rwmjones> yeah ...
<rwmjones> I'm using systems where all the packages go in one place
<joelr1> i see
<rwmjones> but that's OK, just specify the full path instead
<joelr1> ok, one sec
<joelr1> it wants pgocaml now
<joelr1> adding that
<joelr1> rwmjones: pgocaml is not installed using ocamlfind, btw
* rwmjones digs up the full list ...
<joelr1> and neither is mod_caml i think
<joelr1> would have been helpful if ocamlfind was used throughout
<rwmjones> I don't usually install PG'OCaml - just run it out of my $HOME
<rwmjones> very bad habit
<rwmjones> CamlLoad /usr/share/mod_caml/registry.cmo
<rwmjones> CamlLoad extlib/extLib.cma
<rwmjones> CamlLoad netstring/netstring.cma
<rwmjones> CamlLoad calendar/calendar.cma
<rwmjones> CamlLoad /home/rich/d/merjis/freeware/pgocaml/pgocaml.cma
<rwmjones> CamlLoad /home/rich/d/merjis/tools/wiki/html/_bin/cocanwiki.cma
<joelr1> ok, so i'm missing netstring and extlib
<joelr1> one sec
<joelr1> rwmjones: btw, rss was a godsend! i will be migrating http://wagerlabs.com to cocan wiki just as soon as i finish the installation
<joelr1> rwmjones: then i will nee to integrate the haskell version of my easylanguage to c# compiler that's currently running at http://algokit.com (that's the haskell version)
<joelr1> rwmjones: it seems to want ExtString as well
<rwmjones> ExtString is a module provided by extlib
<joelr1> ah, i just have to put it before pgocaml
<rwmjones> joelr1, here's a list from a site which uses cocanwiki with the optional RSS modules installed:
<rwmjones> CamlLoad /home/rich/local/share/mod_caml/registry.cmo
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/site-lib/extlib/extLib.cma
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/site-lib/netstring/netstring.cma
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/site-lib/calendar/calendar.cma
<rwmjones> CamlLoad /home/rich/d/merjis/freeware/pgocaml/pgocaml.cma
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/xml-light.cma
<joelr1> it also needs netsys
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/rss.cma
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/site-lib/equeue/equeue.cma
<rwmjones> CamlLoad /home/rich/local/lib/ocaml/site-lib/netclient/netclient.cma
<rwmjones> #DocumentRoot /home/rich/d/merjis/tools/wiki/html
<rwmjones> CamlLoad /home/rich/d/merjis/tools/wiki/html/_bin/cocanwiki.cma
<rwmjones> no idea what netsys is
<joelr1> i have an idea
<joelr1> ocamlnet
<joelr1> ok, csv is needed as well... adding
<rwmjones> ah right, csv is now required by PG'OCaml
<rwmjones> but I think it is (or ought to be) optional. It's only used for some very optional logging bits.
<joelr1> ok, will report in a couple of minutes...
<joelr1> rwmjones: hmm... there's no install option in the csv makefile...seemingly
<joelr1> Syntax error on line 14 of /Users/joelr/work/ocaml/cocanwiki-1.4.3/conf/cocanwiki.conf:
<joelr1> Failure("environment variable $COCANWIKI_TEMPLATES must be set to point to my 'templates' directory (see README file for more details)")
holo has quit ["Leaving"]
<joelr1> rwmjones: the readme file says nothing about COCANWIKI_TEMPLATES
<rwmjones> ah indeed, just a sec
<rwmjones> take the /etc/init.d/apache file and modify it like this:
<rwmjones> export COCANWIKI_TEMPLATES=/wherever/you/put/the/wiki/templates
<joelr1> ok, that would be apachectl in my case
<joelr1> rwmjones: why is this necessary, btw?
<rwmjones> does apachectl wipe the environment?
<rwmjones> because there is no way for COCANWIKI to find those template files except by hard-coding it somewhere
<joelr1> ok, apachectl loads envvars
<joelr1> so i'll put it there
<rwmjones> for similar reasons you may also need to hard code the database hostname (assuming it's not running on the same machine)
vorago has quit [Read error: 110 (Connection timed out)]
<joelr1> rwmjones: ok, 14:15 <rwmjones> CamlLoad /home/rich/d/merjis/freeware/pgocaml/pgocaml.cma
<joelr1> err
<joelr1> rwmjones: Failure("error while linking /Users/joelr/work/ocaml/cocanwiki-1.4.3/html/_bin/cocanwiki.cma.\nReference to undefined global `Http_client'")
<joelr1> gotta look for this one
<rwmjones> netclient/netclient.cma
<joelr1> unixqueue?
<joelr1> Failure("error while linking /usr/local/lib/ocaml/site-lib/netclient/netclient.cma.\nReference to undefined global `Unixqueue'")
<rwmjones> equeue/equeue.cma
<rwmjones> see above ...
vorago has joined #ocaml
<joelr1> i think that's it
<joelr1> booting up
<rwmjones> have you loaded the cocanwiki.sql into the database and created an initial host?
<joelr1> oh
<joelr1> question
<joelr1> rwmjones: haven't created initial host yet but
<joelr1> rwmjones: how does it know what password www-data has?
<rwmjones> if the database is on the same host, then it doesn't usually need to - it just uses the Unix domain socket to connect
<joelr1> rwmjones: ok
<rwmjones> if it's on a different host, then you need to set the environment variables:
<rwmjones> PGHOST
<rwmjones> PGUSER
<rwmjones> PGPASSWORD
<rwmjones> etc. as appropriate
<joelr1> tried to access the url /_bin/admin/create_host_form.cmo
<joelr1> got an error
<joelr1> [Mon May 21 14:29:33 2007] [error] [client 127.0.0.1] client denied by server configuration: /Users/joelr/work/ocaml/cocanwiki-1.4.3/favicon.ico, referer: http://localhost/_bin/admin/create_host_form.cmo
<joelr1> rwmjones: i have seen this before...
<rwmjones> you need ...
<joelr1> rwmjones: that should have been html/_bin... strange
<rwmjones> are you including cocanwiki.conf ?
<rwmjones> ie. all the stuff like:
<rwmjones> <Location /_bin>
<rwmjones> SetHandler ocaml-bytecode
<rwmjones> CamlHandler Registry.handler
<rwmjones> Options ExecCGI
<rwmjones> Allow from all
<rwmjones> </Location>
<rwmjones> etc?
<rwmjones> if it's not that, then it'll be because your DocumentRoot is wrong
<joelr1> rwmjones: yes, i'm including it. that's where all the CamlLoad complaints came from
<rwmjones> it should point to the html directory
<joelr1> looking at doc root
<rwmjones> back in 5 mins
<joelr1> DocumentRoot "/Users/joelr/work/ocaml/cocanwiki-1.4.3/html"
<joelr1> rwmjones: i think my docroot is fine
<joelr1> rwmjones: never mind, i'm an idiot
<joelr1> rwmjones: now i'm getting the dreaded internal server error w/o any other information. i used to get this with mod_caml "stable" and it went away when i switched to mod_caml cvs
<rwmjones> so nothing in error_log?
<joelr1> nope
<joelr1> rwmjones: nothing in error_log
<joelr1> rwmjones: again, i had this issue with the stable version of mod_caml
<rwmjones> but you said the test scripts worked?
<joelr1> rwmjones: what test scripts?
<rwmjones> things like
<joelr1> rwmjones: i don't think i ever said anything about test scripts
<rwmjones> examples/simple-scripts/hello.cmo
<joelr1> ah!
<joelr1> one sec
<joelr1> rwmjones: well, now they don't
<joelr1> rwmjones: let me try without loading cocan wiki
<joelr1> rwmjones: yep, that's it, without cw hello works
<rwmjones> so the only different is CamlLoad .../cocanwiki.cma ?
<rwmjones> s/different/difference/
<joelr1> well
<joelr1> rwmjones: it works if i don't include the wiki conf
<joelr1> and thus don't load the cma
<joelr1> hmm... i can't just load the wiki cma since it pulls in the rest of the stuff... hmm
dark_light has joined #ocaml
<rwmjones> well load everything except cocanwiki.cma, and try that
<joelr1> rwmjones: do i need to keep all the cmas in one place? because the mod_caml config says they are in one place and then the wiki config puts them in a different place
<rwmjones> I don't understand ... the cmas can go anywhere, but you have to specify paths to them, unless they are in ocamllibdir in which case you can miss out the full path
<joelr1> ok, let me see something
<joelr1> this is my modcaml.conf
<joelr1> CamlLoad /usr/share/mod_caml/registry.cmo
<joelr1>
<joelr1> Alias /caml-icons/ /usr/share/mod_caml/caml-icons/
<joelr1> Alias /caml-bin/ /usr/share/mod_caml/caml-bin/
<joelr1>
<joelr1> <Location /caml-bin>
<joelr1> SetHandler ocaml-bytecode
<joelr1> CamlHandler Registry.handler
<joelr1> Options ExecCGI
<joelr1> Allow from all
<joelr1> </Location>
<joelr1>
<joelr1> let me load all the other cmas
<joelr1> rwmjones: i can load the cmas and still access the hello example
<joelr1> rwmjones: so it must be something in the cocanwiki conf file
<rwmjones> you realise that you don't need modcaml.conf if you have cocanwiki.conf (ie. don't use both at the same time)
<joelr1> rwmjones: didn't know. let me remove modcaml then
<rwmjones> loading the registry.cmo module twice probably didn't do good things
smimou has joined #ocaml
<joelr1> rwmjones: but... i don't see you loading registry in the wiki install page
<joelr1> rwmjones: so i don't think i loaded it twice. checking, though.
<rwmjones> you need to load it once only
<joelr1> rwmjones: right. the wiki install page does not mention loading the registry so it was only loaded once, from mod_caml.conf
<rwmjones> and it needs to be first in the list
<joelr1> rwmjones: i load mod_caml.conf fist. that loads registry and sets up the caml-bin path
<rwmjones> ok try this:
<joelr1> rwmjones: then i load the wiki conf
<rwmjones> copy hello.cmo into the cocanwiki html/_bin directory
<joelr1> rwmjones: ok, sec
<rwmjones> include cocanwiki.conf (ie. all modules)
<rwmjones> then see if you can visit yoursite/_bin/hello.cmo
<rwmjones> if that doesn't work, keep removing CamlLoad lines (starting with the last one & working backwards) until it does work
<joelr1> rwmjones: it works
<rwmjones> another thing - don't use apachectl restart
<rwmjones> you have to stop & start
<joelr1> rwmjones: stop/start
<joelr1> rwmjones: hello works
<rwmjones> so, hello works with all modules loaded?
<joelr1> yes
<joelr1> i load mod_caml.conf first
<joelr1> rwmjones: but! /caml-bin/ is no longer valid after cocanwiki.conf is loaded
<rwmjones> and, /_bin/admin/create_host_form.cmo doesn't work?
<rwmjones> yeah, don't worry about that
<joelr1> rwmjones: correct
<rwmjones> but no error message?
<joelr1> rwmjones: doesn't work
<rwmjones> in error_log
<joelr1> checking again
<rwmjones> also try: /_bin/page.cmo
<joelr1> [Mon May 21 14:55:59 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
<joelr1> [Mon May 21 14:55:59 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache2/bin/suexec)
<joelr1> [Mon May 21 14:56:00 2007] [notice] Digest: generating secret for digest authentication ...
<joelr1> [Mon May 21 14:56:00 2007] [notice] Digest: done
<joelr1> [Mon May 21 14:56:00 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7l DAV/2 mod_caml/1.4.2 configured -- resuming normal operations
<joelr1> this is all i have. trying page
<rwmjones> it's a 500 Internal Server Error, right?
<joelr1> rwmjones: 100%
<joelr1> rwmjones: page fails also
<joelr1> rwmjones: hello seems to work, though
<rwmjones> strange
<rwmjones> but maybe not surprising
<rwmjones> I'm beginning to think it might be a problem connecting to the db
<rwmjones> although it really ought to produce an error message if that is the case
<joelr1> rwmjones: great, how do i troubleshoot?
<rwmjones> this is Solaris right?
<joelr1> rwmjones: i didn't set any variables... hmmm...
<rwmjones> Solaris?
<joelr1> rwmjones: maybe i should set PGHOST=localhost
<joelr1> this is all mac osx
<joelr1> i think i had to set PGHOST when compiling or it would not connect
<rwmjones> I don't think guessing is going to help
<joelr1> one sec
<rwmjones> what you need to do is
<rwmjones> I've forgotten exactly how you do this, but you have to ktrace one of the Apache processes
<rwmjones> while it is performing a request
<joelr1> rwmjones: no, i don't think PGHOST=localhost helped
<rwmjones> this is somewhat random, because the OS will choose a process at random to run for each request, so you'll have to keep 'ktrace' until it happens to get the right process
<rwmjones> or you can start Apache with the -X option
<joelr1> rwmjones: ugh...
<joelr1> rwmjones: let me see if apachectl takes that
<rwmjones> but that will let you see what the process is trying to do
<joelr1> rwmjones: i may be mistaken but my apache2 does not have -X
<rwmjones> kin eck, I think they removed it
<rwmjones> just a sec, let me ask someone
<rwmjones> it's probably to do with the threading model
<rwmjones> in any case, that doesn't stop you from using ktrace on a random Apache process, keep reloading the failure page a dozen or so times, and you should have a trace of the failure
vorago has quit [Read error: 113 (No route to host)]
<joelr1> rwmjones: ktrace... ok
<joelr1> rwmjones: trying
<joelr1> rwmjones: ##$^#$^#$^ it starts 7 of them!
<joelr1> rwmjones: i wonder how can i limit the #
<rwmjones> joelr1, apparently httpd -X should still work?
<joelr1> rwmjones: let me see
<joelr1> rwmjones: don't think so. look
<joelr1> junior:/usr/local/apache2/logs root# apachectl -X start
<joelr1> Usage: /usr/local/apache2/bin/httpd [-D name] [-d directory] [-f file]
<joelr1> [-C "directive"] [-c "directive"]
<joelr1> [-k start|restart|graceful|graceful-stop|stop]
<joelr1> [-v] [-V] [-h] [-l] [-L] [-t] [-S]
<rwmjones> no, you'll need to supply it directly to the httpd process
<rwmjones> like ktrace httpd -X
<rwmjones> maybe ktrace httpd -X -f /etc/httpd.conf or whatever
<joelr1> rwmjones: so i need both ktrace and -X?
<joelr1> rwmjones: ok, tracing
<rwmjones> yup
<joelr1> rwmjones: wow! it would not respond to ^C, i had to ^Z and then kill -9 it
<joelr1> rwmjones: let me see if ktrace produced something of substance
<rwmjones> you need to use kdump iirc
<joelr1> rwmjones: what does this tell you?
<joelr1> rwmjones: [Mon May 21 15:14:05 2007] [Mod_caml] ocaml_bytecode_handler: Uncaught exception
<joelr1> "Unix.Unix_error(20, "connect", "")".
<joelr1> [Mon May 21 15:14:05 2007] [Mod_caml] ocaml_bytecode_handler: Uncaught exception
<joelr1> "Unix.Unix_error(20, "connect", "")".
<joelr1> rwmjones: where is it trying to connect?
<joelr1> rwmjones: ok, i think we are getting closer. look.
<joelr1> 2487 httpd CALL connect(0xb,0xbfffec34,0x23)
<joelr1> 2487 httpd NAMI "/var/run/postgresql/.s.PGSQL.5432"
<joelr1> 2487 httpd RET connect -1 errno 2 No such file or directory
<rwmjones> that looks familiar
<joelr1> rwmjones: i'm happily connected to postgres with navicat, though
<rwmjones> so I'm guessing if you look in /tmp/.s.PGSQL.5432 you'll see a socket, right?
<rwmjones> or somewhere under /tmp ...
<rwmjones> simple fix anyway:
<rwmjones> edit pGOCaml.ml, function 'connect':
<rwmjones> let connect ?host ?port ?user ?(password = "") ?database
<rwmjones> ?(unix_domain_socket_dir = "/var/run/postgresql") () =
<rwmjones> and change that path
<rwmjones> to "/tmp"
<joelr1> rwmjones: .s.PGSQL.5432 and .s.PGSQL.5432.lock in /tmp
<joelr1> rwmjones: sec
<rwmjones> more generally, I could use a patch which somehow determines where this lockfile is located (it lives in fairly random places on different distros) and gets this right
<joelr1> rwmjones: do i nee to recompile anything? ktrace time again
<rwmjones> you'll need to recompile at least PG'OCaml
<joelr1> rwmjones: take a look, you are gonna love this
<joelr1> rwmjones: FATAL: 28000: role "daemon" does not exist
<joelr1> FATAL: 28000: role "daemon" does not exist
<joelr1> [Mon May 21 15:21:11 2007] [Mod_caml] ocaml_bytecode_handler: Uncaught exception "End_of_file".
<joelr1> [Mon May 21 15:21:11 2007] [Mod_caml] ocaml_bytecode_handler: Uncaught exception "End_of_file".
<joelr1> [Mon May 21 15:21:43 2007] [notice] caught SIGTERM, shutting down
vorago has joined #ocaml
<rwmjones> this is after recompiling?
<joelr1> rwmjones: yes
<rwmjones> so you've recompiled PG'OCaml
<rwmjones> stopped and restarted
<joelr1> rwmjones: yes and reinstalled
<rwmjones> does hello.cmo work?
<joelr1> stopped and started
<rwmjones> does page.cmo work?
<joelr1> sec
<joelr1> rwmjones: hello works. checking page
<joelr1> rwmjones: page complains. FATAL: 28000: role "daemon" does not exist
<joelr1> FATAL: 28000: role "daemon" does not exist
<rwmjones> ok, right I understand
<rwmjones> apache is running as user "daemon"
<rwmjones> trying to access the database
<joelr1> rwmjones: ah!
<rwmjones> the database doesn't allow this
<mrvn> Mine is running as www-data
<rwmjones> mrvn: exactly
<rwmjones> so if you grep through cocanwiki.sql for any grants which grant permissions to www-data
<rwmjones> just change them to daemon
<joelr1> rwmjones: PGUSER in the same place where cocam wiki is set?
<rwmjones> and run the grants (on their own) again
<mrvn> I would rather run apache as www-data
<rwmjones> it very much depends on how your pg_hba.conf is set whether just setting PGUSER will work
<joelr1> rwmjones: why don't i try that first? one sec
malc_ has joined #ocaml
<joelr1> woohoo! page works
<rwmjones> ok, so you're almost there now
<rwmjones> just need to go to /_bin/admin/create_host_form.cmo
<joelr1> rwmjones: did that
<joelr1> rwmjones: is this it? how do i get the nice merjis look?
<rwmjones> fiddle around with stylesheets
<rwmjones> if you go to ...
<rwmjones> well, if you're logged in with the right amount of permissions, then go to
<rwmjones> Sitewide settings
<joelr1> rwmjones: one more thing... when i click on homepage it goes to localhost/ which has the default apache page. how do i make it go to the "wiki home"?
<rwmjones> then there's a global stylesheet and a per-page stylesheet to work with
<rwmjones> that must mean that the canonical hostname is set wrong
<rwmjones> try:
<rwmjones> select * from hosts;
<joelr1> rwmjones: i think i typed localhost in there
<rwmjones> and:
<rwmjones> select * from hostnames;
<joelr1> rwmjones: localhost
<rwmjones> the canonical_hostname field is where it will redirect browsers to, so that needs to be right
<rwmjones> furthermore, you need to list all possible hostnames in the hostnames table (including the canonical_hostname)
<rwmjones> so for example ...
<joelr1> rwmjones: so i just type in a url there?
<rwmjones> no, just a hostname,
<rwmjones> for example .....
<joelr1> rwmjones: it _is_ set right in my case, except i was expecting it to go to the top of the wiki, not to pull up /index.html
<rwmjones> select id, canonical_hostname from hosts where id = 11;
<rwmjones> id | canonical_hostname
<rwmjones> ----+--------------------
<rwmjones> 11 | www.merjis.com
<rwmjones> cocanwiki=> select * from hostnames where hostid = 11;
<rwmjones> hostid | name
<rwmjones> --------+---------------------
<rwmjones> 11 | new.demo.merjis.com
<rwmjones> 11 | www.merjis.com
<rwmjones> 11 | merjis.com
<rwmjones> god knows what "new.demo.merjis.com" is though ...
<joelr1> rwmjones: how do i make it pull up the wiki top instead of /index.html. it seems to be doing the right thing, no?
<rwmjones> I don't really know your Apache setup, but if it redirects to http://[canonical_hostname]/ and that is the wrong place, then canonical_hostname is definitely wrong
<joelr1> rwmjones: that is the right place, except there's no wiki there
<rwmjones> & I don't know what 'index.html' is
<rwmjones> the index page is called / or /index
<rwmjones> in COCANWIKI
<joelr1> rwmjones: hmm... let me see something real quick. it's pulling up the apache It Works page but maybe it's cached
<joelr1> rwmjones: mea culpa! it was a cached page. next and, hopefully, final question
<joelr1> rwmjones: are there any default stylesheets supplied with cocanwiki? like the merjis look, for example? is it difficult to customize the look?
<rwmjones> no, but by all means grab the merjis.com stylesheet
<rwmjones> it's probably more fun to make your own though
<joelr1> rwmjones: i will, of course. let me try the merjis one first, real quick
<joelr1> rwmjones: i paste it into the global stylesheet box?
<rwmjones> yeah ... actually the merjis one is really complicated & depends on a bunch of images too
<rwmjones> btw, always Shift+Reload when trying out stylesheet changes
<rwmjones> back in 10
<joelr1> rwmjones: i would go for the cocan.org stylesheet
<joelr1> thanks
<joelr1> mrvn: would you know how to remove the bunch of links including versions of this page from the bottom of the default wiki?
<joelr1> with the cocan.org stylesheet
<joelr1> rwmjones: ^^^
<rwmjones> joelr1, you can edit the templates, but normally what you'd do is just hide it by putting display:none in the stylesheet
<rwmjones> depending on the security settings for anon users, they will or won't see the history link
<joelr1> rwmjones: and where would i change security settings for anon users?
<rwmjones> basically you can select security level for a spectrum from open wiki <---> commercial website
<rwmjones> in Sitewide Settings
<joelr1> rwmjones: i want commercial website, looking
<rwmjones> yeah, so set it up as:
<joelr1> rwmjones: hmm... do i need to login? as what user by default?
<rwmjones> Allow anyone to see the site: Yes
<rwmjones> Allow anonymous edits: No
<rwmjones> Allow anyone to create accounts: No
<rwmjones> do select * from users;
<joelr1> sec
<rwmjones> if you don't have any users set up, create one either by inserting into that table, or by going to the 'Site Administration' link at the bottom of the page
<rwmjones> you'll want to give yourself the "can_manage_users" permissions, which is kind of like 'root'
<joelr1> rwmjones: i go to sitewide settings but i don't see the options that you see
<joelr1> i just see users, edit site menu, homepage, sitemap, recent changes
<joelr1> and the interesting pages and links section
<joelr1> ok, that's under Users
<rwmjones> go into users and give yourself some permissions
<rwmjones> if you can't do that, then set can_manage_users in the users table directly
<joelr1> rwmjones: yes, gotta do that i think
<joelr1> rwmjones: wait, i can manage users. where are the settings for anon user, though?
<rwmjones> the anon user is not a user
<rwmjones> the settings above are on the Sitewide settings page
<joelr1> rwmjones: so i edited administrator. how do i restrict anon settings?
<rwmjones> go to Sitewide settings
<joelr1> rwmjones: never mind, got it
<joelr1> rwmjones: interesting... it appears i can pick a theme
<joelr1> rwmjones: what does picking a theme do? does it override global stylesheet?
<rwmjones> no, it adds an extra stylesheet before the global stylesheet
<joelr1> rwmjones: i picked merjis but the look didn't seem to change, even after restartin the browser
<rwmjones> best thing to do is to look at the source for /index after each change, or else look at the file templates/page_header.html
<joelr1> rwmjones: ok, thanks. the theme thing didn't work for some reason. let me just check one last thing, i.e. the rsss for the home page
<joelr1> rwmjones: can you remind me, please, where are the rss feeds per page?
<joelr1> rwmjones: found, thanks!
<rwmjones> there are lots - grep cocanwiki.conf for rss
<joelr1> woohoo!
<joelr1> rwmjones: thank you very much for an awesome product. gotta go install on solaris now :D
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<joelr1> rwmjones: once again, thanks! over and out
joelr1 has quit ["rcirc on GNU Emacs 22.0.50.1"]
<flux> I tried that a year ago or so.. I gave up :) (I didn't try very hard, though)
smimram has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
tree_ has quit [Read error: 110 (Connection timed out)]
Sparkles has quit []
tree has joined #ocaml
gim_ has joined #ocaml
seafood has quit []
postalchris has joined #ocaml
postalchris has quit [Client Quit]
postalchris has joined #ocaml
benny_ has joined #ocaml
Hadaka has quit [pratchett.freenode.net irc.freenode.net]
seafood has joined #ocaml
pango__ has joined #ocaml
pango__ is now known as pango
pango_ has quit [Remote closed the connection]
benny has quit [Read error: 110 (Connection timed out)]
cjeris has joined #ocaml
Smerdyakov has joined #ocaml
dark_light has quit [Read error: 101 (Network is unreachable)]
ita|zzz is now known as ita
ygrek has joined #ocaml
bluestorm_ has joined #ocaml
love-pingoo has joined #ocaml
Submarine has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
beterraba has joined #ocaml
<beterraba> somebody know isabelle/isar?
<ita> beterraba: coq
<beterraba> what coq means?
<Smerdyakov> Coq is number one theorem prover of the universe!
<ita> beterraba: it is another prover
<ita> Smerdyakov: :-)
<beterraba> yes"
<beterraba> =)
<beterraba> but..
<beterraba> do u domain some of them?
<beterraba> Smerdyakov, do u know where can i find some chat or discussion group about isabelle / isar?
<Smerdyakov> No.
<beterraba> i'm having some troubles and i need assistence
<Smerdyakov> Well, you won't find it here. Sorry.
<beterraba> ok.
screwt8 has quit [Remote closed the connection]
<beterraba> well.. but do u know anything about modal logic. i mean, have u already proved something about it in coq?
<beterraba> hello? =(
<ita> beterraba: try #isabelle one never knows
<beterraba> no one. =/
<ita> beterraba: i have proved very simple things and i doubt i can help you much
<ita> beterraba: what are you trying to do by the way ?
* ita is too curious .. but sometimes it is a good thing(tm)
<beterraba> hm.. im trying to prove there is a finite way to express the same formula ALPHA just combinating modal unary operations
<beterraba> i must use structural induction.
<beterraba> u know what modal unary operations mean, right?
screwt8 has joined #ocaml
<beterraba> there are 2 of them: one represents necessity and the other represents possibility
<beterraba> my task is prove there are only 14 forms to represent formulas by combinating modal operators
<ita> beterraba: you should try the isabelle mailing-list right now
<beterraba> what is that?
<ita> beterraba: search in the coq collection of proofs too, it might help
<Smerdyakov> ita, that sounds like very bad advice.
<ita> beterraba: here, i doubt anyone can really help you
<Smerdyakov> (to search Coq proofs)
<ita> Smerdyakov: why ?
<Smerdyakov> Because they're very different tools.
<ita> ah
<ita> well, the principle behind is the same
<ita> or should be :-)
<Smerdyakov> No.
<beterraba> thanks
<beterraba> i will thy
<beterraba> try*
<Smerdyakov> There are without doubt informal pencil-and-paper proofs of the theorems of interest, and reading those would be better than reading proofs in a different system.
<ita> well, if he came here to ask for help he must be really desperate :-)
<beterraba> lol
<beterraba> i am!
<Smerdyakov> beterraba, I guess this is for a class?
malc_ has quit ["leaving"]
<ita> beterraba: Smerdyakov is tough you know, i guess we all become grumpy after knowing lots of things
<beterraba> +-
<Smerdyakov> beterraba, is that a yes?
<beterraba> yes and no
<beterraba> let me try explain:
<ita> mas o menos
<beterraba> firstly sorry my english if u dont understand what im saying =P .. it's a scientific project which i should use some computacional tool with mathematical reasoning. my search and project is about modal logic and structural induction over this kind of logic. but i'm having some sintatical troubles and need help urgently. i must finish this work in 31st may.
<Smerdyakov> beterraba, don't you have an advisor you can ask?
mnemonic has joined #ocaml
<beterraba> yes, i do. but im shame (i dont know how spell it)
<mnemonic> hi
<Smerdyakov> If you are unable to talk to the person in charge of your project for emotional reasons, then you're already lost beyond hope of redemption.
<Smerdyakov> It generally takes a few YEARS to learn to use a theorem proving tool like Isabelle effectively.
<ita> years ? omg
<Smerdyakov> General rule of thumb: it takes as long to reach some level of proficiency at computer theorem proving as it took to reach the same level of proficiency at programming.
<ita> in a few weeks i could do interesting things in coq already
<ita> the coq tutorial is not too intuitive, and the concepts are a bit scattered all around
<Smerdyakov> You probably did them in crappy, non-maintainable ways. ;)
<Smerdyakov> (Just like in programming!)
<Smerdyakov> (At a correspondingly early stage, I mean)
<cjeris> learning coq is certainly much more like learning C++ than it is like learning a civilized language.
<Smerdyakov> I don't think anyone knows how to do any better than Coq in this domain..
<ita> Smerdyakov: there are less than 100 regular users, let's bet on the quantity
<Smerdyakov> I'm pretty sure the number is higher than that.
<Smerdyakov> That was the number from a survey a few years ago.
<Smerdyakov> And Coq is getting more popular.
<ita> the coq error messages are clear like joe black in a tunnel with a zorro mask at midnight
<Smerdyakov> If it matters enough to you, then you can work on improving them. I don't think there has ever been any other theorem proving tool in the history of mankind that compares to Coq for quality, though.
rwmjones has quit ["Closed connection"]
<ita> Smerdyakov: in the history of compilers, coq compares to branefsk :-)
<Smerdyakov> Completely irrelevant.
<ita> yes.
<ita> (coffee overload)
<Smerdyakov> You don't seem to understand that we are in the early days of practical proof assistants for higher-order logic.
<Smerdyakov> Nothing good springs fully formed.
<bluestorm_> (isn't that what the POPLmark challenge is about ?)
seafood has quit []
<Smerdyakov> bluestorm_, exactly what do you mean?
<bluestorm_> hm
<Smerdyakov> Lately, the POPLmark challenge is about "no one wants to try the challenge problems I suggest." =(
<bluestorm_> about "we are at spring, let's see how good we can get now"
<bluestorm_> but anyway i don't know the subject
<bluestorm_> so i'm lot likely to know something interesting
<Smerdyakov> I have the best approach to compiler certification, but no one is willing to post alternative solutions to the problems I suggest. :P
malc_ has joined #ocaml
<Smerdyakov> mbishop, yes, and?
* mbishop shrugs
<mbishop> Just found that
<mbishop> Smerdyakov: you're working there (or will be) aren't you? gonna get them to release some more stuff? :P
holo has joined #ocaml
<holo> hi
<ita> holo: hola
<holo> i want to add a counter to a lexer, so it can count the column a token is ocurring. code: http://rafb.net/p/Kt3N4A52.html
<holo> hi ita
<holo> but i can't get the design to it in my head
<holo> i thought of getting the value of the counter by its argument, but i don't even know if caml can do that
<ita> holo: wait, shouldnt you do that in the parser ?
<holo> in C for example i would get the variable by reference
<holo> ita, is this situation no
<holo> but in this case i can't really get the counter becouse i call it by: alex_scan(code, 1);;
<holo> so, the argument is called with initialization
<holo> for obvious reasons, this doesn't work: [<'`&`>] -> count, [<'E; alex_scan(code, count+1)>]
<holo> the "count" in the return branch
<holo> i thought of a let var = func in expr
<holo> is this last option viable?
* ita has no idea
<holo> this may seem weird code, those are streams, with imperative behavior
<holo> and caml light forbids branches with different return types
<holo> so i can't do: | [<>] -> count, [<>]
<holo> and at the same time do: | [<'`:`>] -> [<'DOIS_PONTOS; alex_scan(code, count+1)>]
<ita> (perhaps define a new return type ? but form me counting tokens should be part of the parser, not the lexer)
<holo> [<'`&`>] -> let code_res, count_res = alex_scan(code, count) in [<'E; alex_scan(code_res, count_res+1)>]
<holo> this is like weird right?
<holo> code and count are in "let rec alex_scan(code, count) = match code with"
<holo> ita, define a return type? what do you mean?
<holo> ita, it should be part of the lexer for eficience reasons
<holo> if a token that is not part of the language in inputed, it should exit imediatly before going to the syntax analiser
<holo> argh.. i can't think of let in with streams
<holo> something is wrong
<holo> ok, i think i have another of doing this :.
<holo> :>
<holo> thank you anyway ita
beterraba has quit [Remote closed the connection]
Oxylin has joined #ocaml
<ita> holo: well, a type some of stuff | none
<ita> holo: since you want to return more than more thing, you can aggregate them instead
<ita> holo: and for the efficiency reason, that part looks totally irrelevant to me :-)
<ita> holo: when you have a proof that the system is way too slow you would recode that part in c anyway, so there is no need to try to think about optimizations at this point
gene9 has joined #ocaml
ita is now known as waf
G_ is now known as G
waf is now known as ita
Oxylin has quit [Client Quit]
cjeris has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
Mr_Awesome has joined #ocaml
gene9 has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
Demitar has quit [Read error: 110 (Connection timed out)]
holo has quit ["This computer has gone to sleep"]
CosmicRay has quit ["Client exiting"]
Demitar has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
Submarine has quit ["Leaving"]
malc_ has quit ["leaving"]
Smerdyakov has quit ["Leaving"]
_JusSx_ has joined #ocaml
mnemonic has quit ["leaving"]
screwt8 has quit [Remote closed the connection]
slipstream-- has joined #ocaml
screwt8 has joined #ocaml
slipstream has quit [Read error: 113 (No route to host)]
<mbishop> Anyone ever thought about making a "planet" for ocaml blogs?
_JusSx_ has quit ["leaving"]
gim_ has quit ["bonne nuit à vous"]
ppsmimou has quit [pratchett.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
ppsmimou has joined #ocaml
_blackdog has joined #ocaml