gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
async has joined #ocaml
<async> whats the best way to learn ocamllex/ocamlyacc
<async> im having problems with it
<async> and the single example they use is not very thorough
<Smerdyakov> Perhaps seek explanations of other lex/yacc variants.
<Smerdyakov> Or take 164
<async> im not allowed to take upper-div classes
<async> until i declare a major
<Smerdyakov> So declare a major.
zorkadi has joined #ocaml
rox has quit [Operation timed out]
zorkadi has left #ocaml []
rox has joined #ocaml
<async> what would be the regexp for something like {343,1331,2197,4913,6859,12167,24389,29791,50653,68921,79507}
<Smerdyakov> "The regexp">
<Smerdyakov> ?
<async> regular expression
<Smerdyakov> Yes, but your question is unclear to me. I don't know it "the regexp for ____" means.
ne1 has joined #ocaml
<async> if i was searching for such an expressoin
<async> what kind of regexp would match that
<async> er
<async> what regexp would match it
<Smerdyakov> .*
<Smerdyakov> Also, the exact string itself.
ne_one has joined #ocaml
ne_one has quit [Read error: 54 (Connection reset by peer)]
<Smerdyakov> Clearly one example string is not enough to uniquely determine a regular language....
LordBrain has joined #ocaml
Shammah has joined #ocaml
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
bzzbzz has joined #ocaml
bzzbzz has left #ocaml []
LordBrain has quit ["laterz"]
CiscoKid has joined #ocaml
rox has quit [Read error: 110 (Connection timed out)]
<async> i want to parse a certain repetitive block of text
<async> is anyone familiar with ocamllex/yacc?
<async> im having trouble formatting the rules
Snark has joined #ocaml
<Snark> slt
rox has joined #ocaml
<bk_> lut
ne1 has quit ["To understand recursion, you must first understand recursion."]
playtpus is now known as platypus_zzz
rox has quit [Read error: 60 (Operation timed out)]
rox has joined #ocaml
platypus_zzz is now known as platypus
rox has quit [Read error: 60 (Operation timed out)]
rox has joined #ocaml
_JusSx_ has joined #ocaml
CiscoKid has quit ["http://lice.codehack.com"]
<platypus> what does one ';' mean ?
<_fab> its the sequence operator, only the second value is "returned"
<platypus> _fab, so this means : really_input chan result 0 len;
<platypus> result
<platypus> ;;
<platypus> only result is returned ?
<_fab> yes
<platypus> _fab, what does this : This expression has type (string -> 'a -> 'b, out_channel, 'a -> 'b) format
<platypus> but is here used with type (string -> 'a -> 'b, out_channel, unit) format
<platypus> mean ??
<platypus> what does the 'a->'b mean ?
<_fab> 'a -> 'b is a function which gets a value of type 'a and returns a value of type 'b
<_fab> 'a and 'b are just placeholders for types
<_fab> the error message means that you gave a unit value instead of a function of type 'a -> 'b
<platypus> when i put this : Printf.printf "read from %d" (String.length) filename;;
<platypus> in my code
<platypus> i get that error
<platypus> hmmm it's not easy to understand this type thingy
<platypus> :(
<bk_> Printf.printf "read from %d" (String.length filename) ;;
<platypus> bk_, ummm what just happened ?
<platypus> String.length filename --> returns the length of filename ?
<bk_> no, it returns the length of a string
<bk_> er
<bk_> yes
<bk_> sry, too tired i guess
<platypus> bk_, no problem ... ummm dude .. is there like a url or something i can read to get into this ocaml thinking paradigm ? ... i come from a python background and i am not faring too good altho i read thru most of the tutorials i still cannot get a handle on it
<_fab> platypus: its Printf.printf "read from %d" (String.length filename);;
<bk_> and then there's the caltech intoduction which is good
<platypus> _fab, thanks
<platypus> bk_, caltech intro at www.ocaml.org rite ?
<bk_> yes
<bk_> also the o'reilly book is pretty good
<platypus> bk_, oreilly book ?
<platypus> got it
<platypus> thanks
<platypus> what projects have been built using ocaml ?
<platypus> i know of some desktop app on lindows that is built using ocaml
<bk_> there're bigger ones and more scientific ones tho, the caml site has a list
<platypus> wonder how ocaml would fare for system administration tool ? u guys / gals have any exp ?
<bk_> nope
gim has joined #ocaml
<platypus> bk_, what do you use it for >?
<bk_> i'm learning ocaml
<bk_> just writing a tiny toyapp for learning purposes
<platypus> hmmm ok
<platypus> what programming background do you come from ?
<bk_> an imperative one
<bk_> C/C++
<platypus> hmmm okay
<platypus> i come from a python/ruby bground
<platypus> bk_, why the move ?
<Tram> C
<platypus> hi Tram
<Tram> I had to learn caml-light for school...
<bk_> curiosity
<Tram> First I hated it, now I love it
<platypus> the pattern matching is superb
<platypus> i like the style
<Tram> I just regret not to work on a bigger project
<bk_> C is the horror, at least i've started to think so recently
<platypus> well i tried my hand on other functional based langs too like ghc ... but ghc has way too many ( )
<platypus> bk_, why >?
<bk_> because of all the evil things you can do with it or with your program
<Tram> I recently worked again on a C program. Each minute I thought that would be much bette in caml...
<platypus> :)
<Tram> i'm going to take a shower
<bk_> i used to think 'heck, i don't need GC - i know what i'm doing', but now i just love it, modern GCs are really nice
<platypus> bk_, GCs ?
<bk_> garbage collectors
Tram has quit [Remote closed the connection]
karryall has joined #ocaml
Lemmih has joined #ocaml
Shammah has quit ["Leaving"]
demitar_ has quit [Read error: 104 (Connection reset by peer)]
demitar__ has joined #ocaml
bk_ has quit ["leaving"]
noss has joined #ocaml
Axioplase has joined #ocaml
<platypus> which types of functions are not values ?
<platypus> functions that can be simplified ?
<Axioplase> Chat Lu!
<Axioplase> (hi)
bzzbzz has joined #ocaml
cjohnson has quit [Remote closed the connection]
GreyLensman has joined #ocaml
yella_ has joined #ocaml
yella_ has quit [Client Quit]
demitar__ is now known as Demitar
<yella> how do you say to OCamlMakefile-managed makefile to include a C object archive ?
<karryall> platypus: all functions are values
<yella> so it executes for example: ocamlc <flags> <incdirs> foo.cma -cclib -lsomelib -o foo <HERE the .a file>
<Snark> yella: perhaps adding something to OCAMLNLDFLAGS ?
vezenchio has joined #ocaml
gwe3`wats has joined #ocaml
ne1 has joined #ocaml
<yella> heh
<yella> OCAMLLDFLAGS worked
<yella> not really a flag but..it works
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
mij has joined #ocaml
tyl3r has quit [Remote closed the connection]
tyl3r has joined #ocaml
noss has quit ["Leaving"]
mt99 has joined #ocaml
karryall has quit [Read error: 110 (Connection timed out)]
mt99 has quit [Read error: 54 (Connection reset by peer)]
GreyLensman has quit ["Leaving"]
mij has quit ["Lost terminal"]
<Axioplase> hum. i have many images converted in files, and i want to load all of them in a single array. How should i create this array?
<Axioplase> sprite=Array.init 9 (function i->create_image 30 30);; seems ok. but ocaml says that there is no screen found yet..
<Axioplase> then. how can i load em in memory ?
<ne1> Is create_image a Tk thing?
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
<Axioplase> no. a Graphics one.
<Axioplase> K found out.
<Axioplase> Exception:
<Axioplase> Graphics.Graphic_failure "Xlib error: BadPixmap (invalid Pixmap parameter)".
<Axioplase> Argh.
<ne1> My sympathy.
<Axioplase> thanks. I'll need some :)
<Axioplase> geez. stoopid me.
ne1 has quit ["To understand recursion, you must first understand recursion."]
bk_ has joined #ocaml
Snark has quit ["Parti"]
Phreaze has joined #ocaml
Axioplase has quit [Nick collision from services.]
Phreaze is now known as Axioplase
sproctor has joined #ocaml
sproctor has quit [Remote closed the connection]
sproctor has joined #ocaml
sproctor has quit [Remote closed the connection]
cjohnson has joined #ocaml
lucifer_ has joined #ocaml
<lucifer_> hi
<Lemmih> yo
cjohnson has quit ["Drawn beyond the lines of reason"]
mattam_ is now known as mattam
<Axioplase> what is the equivalent of the C function "hypot" ??
<Smerdyakov> I am not aware of any standard C function by that name.
cjohnson has joined #ocaml
<Lemmih> let hypot x y = sqrt(float(x*2+y*2));;
<Axioplase> thks :)
<mellum> no, it would be let hypot x y = sqrt (x *. x +. y *. y)
<Lemmih> D'oh
_fab has quit [Read error: 110 (Connection timed out)]
_JusSx_ has quit ["[BX] The FDA says 5 servings of BitchX a day increases sexual potency"]
lucifer_ has quit ["BitchX-1.0c19 -- just do it."]
cjohnson has quit [Remote closed the connection]
kinners has joined #ocaml
cjohnson has joined #ocaml
<async> whos good w/ lex and yacc?
<async> i need some help parsing text
<async> i can't seem to figure out the rules
<async> btw, if you're not making any sort of language, is it even worth it to use lex/yacc?
<Smerdyakov> By definition, lex and yacc can only be used for parsing languages. The complexity of the languages may vary.
<Smerdyakov> I understand lex and yacc.
<async> i want to be able to parse something like this
<async> from "number)" to "Returns: "
<async> ive been trying to come up with lex/yacc rules to do that, but it doens't really work
<async> i might just try a recursive approach
<kinners> is that for the icfp contest?
<async> no
<Smerdyakov> Do you understand what lex and yacc are?
<async> yeah
<Smerdyakov> What are they? (Individual answer for each, please)
<async> not too well though... i can write rules that tokenize all that stuff well
<async> but i can't seem to put it together in yacc
<async> im having trouble with the arrays
<Smerdyakov> Well, if you're not going to ask more specific questions and you want my help, you'll need to indicate what you know about what lex and yacc are.
<async> thats the lexer
<async> parser
<simon-> when is the icfp contest? I didn't miss it did I?
<async> its in june
<simon-> ah. I'm on the mailing list so you surprised me a bit there.
<async> the parser is incomplete, i dont know how to link several values together
<async> like an array followed by a 0 followed by another array
gim has quit ["bonne nuit les geek"]
<async> hell, i dont know how to parse arrays
<Smerdyakov> async, I don't believe you that the standard documentation won't show you how to do that.
<async> all the standard documentation assumes you're writing some sort of interpreter or calculator
<async> not a text parser
<Smerdyakov> That should not matter for your understanding of the basic principles.
<async> how would you do an array
<async> which could potentially have sub-arrays
<async> '{' [^ '}']* '}' doesn't work, because it would choke on sub-arrays
<async> you need to tokenize the brackets
<async> but then you gotta work with commas
<Smerdyakov> Do you understand how to parse any grammar that includes strings of unbounded size? I.e., simple lists, etc..
<async> no
<Smerdyakov> Then read the documentation.
tyler__ has joined #ocaml
<async> the documentation on lex or yacc?
<Smerdyakov> Yacc
<async> Smerdyakov: i'f you could tell me something a little more specific then 'read the documentation', that would be most useful
<Smerdyakov> You use recursion in rules to parse recursive grammars.
<Smerdyakov> Does that help?
<Smerdyakov> (This should already be clear from the documentation.)
<tyler__> evening all, anyone can tell me how to call the constructor of type : type lsystem = { a: string; b: string} please ?
<tyler__> just cant find it in many courses that Ive read
<kinners> tyler__: let bla = {a="foo"; b="bar"};;
<simon-> tyler__, ocaml automatically determines the type
<simon-> hey, did you guys see microsoft's attempt at duplicating ocaml into its .net platform?