00:32
async has joined #ocaml
00:32
<
async >
whats the best way to learn ocamllex/ocamlyacc
00:32
<
async >
im having problems with it
00:33
<
async >
and the single example they use is not very thorough
00:41
<
Smerdyakov >
Perhaps seek explanations of other lex/yacc variants.
00:41
<
Smerdyakov >
Or take 164
00:44
<
async >
im not allowed to take upper-div classes
00:44
<
async >
until i declare a major
00:48
<
Smerdyakov >
So declare a major.
01:05
zorkadi has joined #ocaml
01:08
rox has quit [Operation timed out]
01:15
zorkadi has left #ocaml []
01:16
rox has joined #ocaml
01:35
<
async >
what would be the regexp for something like {343,1331,2197,4913,6859,12167,24389,29791,50653,68921,79507}
01:37
<
Smerdyakov >
"The regexp">
01:37
<
async >
regular expression
01:38
<
Smerdyakov >
Yes, but your question is unclear to me. I don't know it "the regexp for ____" means.
01:38
ne1 has joined #ocaml
01:38
<
async >
if i was searching for such an expressoin
01:39
<
async >
what kind of regexp would match that
01:39
<
async >
what regexp would match it
01:40
<
Smerdyakov >
Also, the exact string itself.
01:41
ne_one has joined #ocaml
01:41
ne_one has quit [Read error: 54 (Connection reset by peer)]
01:42
<
Smerdyakov >
Clearly one example string is not enough to uniquely determine a regular language....
01:54
LordBrain has joined #ocaml
03:14
Shammah has joined #ocaml
03:46
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 ]
04:28
bzzbzz has joined #ocaml
04:29
bzzbzz has left #ocaml []
04:33
LordBrain has quit ["laterz"]
04:36
CiscoKid has joined #ocaml
05:50
rox has quit [Read error: 110 (Connection timed out)]
05:52
<
async >
i want to parse a certain repetitive block of text
05:53
<
async >
is anyone familiar with ocamllex/yacc?
05:53
<
async >
im having trouble formatting the rules
06:03
Snark has joined #ocaml
06:11
rox has joined #ocaml
06:18
ne1 has quit ["To understand recursion, you must first understand recursion."]
06:54
playtpus is now known as platypus_zzz
07:33
rox has quit [Read error: 60 (Operation timed out)]
07:46
rox has joined #ocaml
08:32
platypus_zzz is now known as platypus
08:36
rox has quit [Read error: 60 (Operation timed out)]
08:42
rox has joined #ocaml
09:05
_JusSx_ has joined #ocaml
09:07
<
platypus >
what does one ';' mean ?
09:08
<
_fab >
its the sequence operator, only the second value is "returned"
09:09
<
platypus >
_fab, so this means : really_input chan result 0 len;
09:09
<
platypus >
only result is returned ?
09:10
<
platypus >
_fab, what does this : This expression has type (string -> 'a -> 'b, out_channel, 'a -> 'b) format
09:10
<
platypus >
but is here used with type (string -> 'a -> 'b, out_channel, unit) format
09:11
<
platypus >
what does the 'a->'b mean ?
09:11
<
_fab >
'a -> 'b is a function which gets a value of type 'a and returns a value of type 'b
09:11
<
_fab >
'a and 'b are just placeholders for types
09:12
<
_fab >
the error message means that you gave a unit value instead of a function of type 'a -> 'b
09:28
<
platypus >
when i put this : Printf.printf "read from %d" (String.length) filename;;
09:28
<
platypus >
in my code
09:28
<
platypus >
i get that error
09:29
<
platypus >
hmmm it's not easy to understand this type thingy
09:30
<
bk_ >
Printf.printf "read from %d" (String.length filename) ;;
09:31
<
platypus >
bk_, ummm what just happened ?
09:31
<
platypus >
String.length filename --> returns the length of filename ?
09:31
<
bk_ >
no, it returns the length of a string
09:32
<
bk_ >
sry, too tired i guess
09:32
<
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
09:33
<
_fab >
platypus: its Printf.printf "read from %d" (String.length filename);;
09:33
<
bk_ >
and then there's the caltech intoduction which is good
09:34
<
platypus >
_fab, thanks
09:35
<
bk_ >
also the o'reilly book is pretty good
09:35
<
platypus >
bk_, oreilly book ?
09:38
<
platypus >
what projects have been built using ocaml ?
09:39
<
platypus >
i know of some desktop app on lindows that is built using ocaml
09:40
<
bk_ >
there're bigger ones and more scientific ones tho, the caml site has a list
09:48
<
platypus >
wonder how ocaml would fare for system administration tool ? u guys / gals have any exp ?
09:52
gim has joined #ocaml
09:54
<
platypus >
bk_, what do you use it for >?
09:54
<
bk_ >
i'm learning ocaml
09:55
<
bk_ >
just writing a tiny toyapp for learning purposes
09:57
<
platypus >
what programming background do you come from ?
09:57
<
bk_ >
an imperative one
09:57
<
platypus >
hmmm okay
09:58
<
platypus >
i come from a python/ruby bground
09:58
<
platypus >
bk_, why the move ?
09:58
<
Tram >
I had to learn caml-light for school...
09:59
<
Tram >
First I hated it, now I love it
10:00
<
platypus >
the pattern matching is superb
10:00
<
platypus >
i like the style
10:01
<
Tram >
I just regret not to work on a bigger project
10:02
<
bk_ >
C is the horror, at least i've started to think so recently
10:02
<
platypus >
well i tried my hand on other functional based langs too like ghc ... but ghc has way too many ( )
10:02
<
platypus >
bk_, why >?
10:03
<
bk_ >
because of all the evil things you can do with it or with your program
10:03
<
Tram >
I recently worked again on a C program. Each minute I thought that would be much bette in caml...
10:04
<
Tram >
i'm going to take a shower
10:04
<
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
10:07
<
platypus >
bk_, GCs ?
10:07
<
bk_ >
garbage collectors
10:25
Tram has quit [Remote closed the connection]
10:47
karryall has joined #ocaml
11:56
Lemmih has joined #ocaml
12:31
Shammah has quit ["Leaving"]
12:41
demitar_ has quit [Read error: 104 (Connection reset by peer)]
12:41
demitar__ has joined #ocaml
13:09
bk_ has quit ["leaving"]
13:13
noss has joined #ocaml
14:18
Axioplase has joined #ocaml
14:18
<
platypus >
which types of functions are not values ?
14:18
<
platypus >
functions that can be simplified ?
14:18
<
Axioplase >
Chat Lu!
14:23
bzzbzz has joined #ocaml
14:31
cjohnson has quit [Remote closed the connection]
14:33
GreyLensman has joined #ocaml
14:52
yella_ has joined #ocaml
14:52
yella_ has quit [Client Quit]
14:53
demitar__ is now known as Demitar
14:53
<
yella >
how do you say to OCamlMakefile-managed makefile to include a C object archive ?
14:58
<
karryall >
platypus: all functions are values
15:15
<
yella >
so it executes for example: ocamlc <flags> <incdirs> foo.cma -cclib -lsomelib -o foo <HERE the .a file>
15:22
<
Snark >
yella: perhaps adding something to OCAMLNLDFLAGS ?
15:27
vezenchio has joined #ocaml
15:27
gwe3`wats has joined #ocaml
15:29
ne1 has joined #ocaml
15:32
<
yella >
OCAMLLDFLAGS worked
15:32
<
yella >
not really a flag but..it works
15:35
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 ]
15:40
mij has joined #ocaml
16:01
tyl3r has quit [Remote closed the connection]
16:21
tyl3r has joined #ocaml
16:39
noss has quit ["Leaving"]
16:43
mt99 has joined #ocaml
16:59
karryall has quit [Read error: 110 (Connection timed out)]
17:03
mt99 has quit [Read error: 54 (Connection reset by peer)]
17:34
GreyLensman has quit ["Leaving"]
18:06
mij has quit ["Lost terminal"]
18:10
<
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?
18:20
<
Axioplase >
sprite=Array.init 9 (function i->create_image 30 30);; seems ok. but ocaml says that there is no screen found yet..
18:24
<
Axioplase >
then. how can i load em in memory ?
18:25
<
ne1 >
Is create_image a Tk thing?
18:27
mattam_ has joined #ocaml
18:28
mattam has quit [Read error: 60 (Operation timed out)]
18:39
<
Axioplase >
no. a Graphics one.
18:48
<
Axioplase >
K found out.
18:55
<
Axioplase >
Exception:
18:55
<
Axioplase >
Graphics.Graphic_failure "Xlib error: BadPixmap (invalid Pixmap parameter)".
18:55
<
Axioplase >
thanks. I'll need some :)
18:57
<
Axioplase >
geez. stoopid me.
19:37
ne1 has quit ["To understand recursion, you must first understand recursion."]
19:54
bk_ has joined #ocaml
20:05
Snark has quit ["Parti"]
20:07
Phreaze has joined #ocaml
20:10
Axioplase has quit [Nick collision from services.]
20:10
Phreaze is now known as Axioplase
20:31
sproctor has joined #ocaml
20:34
sproctor has quit [Remote closed the connection]
20:38
sproctor has joined #ocaml
20:41
sproctor has quit [Remote closed the connection]
21:06
cjohnson has joined #ocaml
21:22
lucifer_ has joined #ocaml
21:24
cjohnson has quit ["Drawn beyond the lines of reason"]
21:25
mattam_ is now known as mattam
21:31
<
Axioplase >
what is the equivalent of the C function "hypot" ??
21:31
<
Smerdyakov >
I am not aware of any standard C function by that name.
21:32
cjohnson has joined #ocaml
21:33
<
Lemmih >
let hypot x y = sqrt(float(x*2+y*2));;
21:35
<
Axioplase >
thks :)
21:36
<
mellum >
no, it would be let hypot x y = sqrt (x *. x +. y *. y)
21:40
_fab has quit [Read error: 110 (Connection timed out)]
21:48
_JusSx_ has quit ["[BX] The FDA says 5 servings of BitchX a day increases sexual potency"]
22:03
lucifer_ has quit ["BitchX-1.0c19 -- just do it."]
22:04
cjohnson has quit [Remote closed the connection]
22:49
kinners has joined #ocaml
23:02
cjohnson has joined #ocaml
23:25
<
async >
whos good w/ lex and yacc?
23:25
<
async >
i need some help parsing text
23:25
<
async >
i can't seem to figure out the rules
23:28
<
async >
btw, if you're not making any sort of language, is it even worth it to use lex/yacc?
23:33
<
Smerdyakov >
By definition, lex and yacc can only be used for parsing languages. The complexity of the languages may vary.
23:33
<
Smerdyakov >
I understand lex and yacc.
23:35
<
async >
i want to be able to parse something like this
23:35
<
async >
from "number)" to "Returns: "
23:36
<
async >
ive been trying to come up with lex/yacc rules to do that, but it doens't really work
23:36
<
async >
i might just try a recursive approach
23:37
<
kinners >
is that for the icfp contest?
23:38
<
Smerdyakov >
Do you understand what lex and yacc are?
23:39
<
Smerdyakov >
What are they? (Individual answer for each, please)
23:39
<
async >
not too well though... i can write rules that tokenize all that stuff well
23:39
<
async >
but i can't seem to put it together in yacc
23:39
<
async >
im having trouble with the arrays
23:43
<
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.
23:44
<
async >
thats the lexer
23:46
<
simon- >
when is the icfp contest? I didn't miss it did I?
23:46
<
async >
its in june
23:46
<
simon- >
ah. I'm on the mailing list so you surprised me a bit there.
23:46
<
async >
the parser is incomplete, i dont know how to link several values together
23:47
<
async >
like an array followed by a 0 followed by another array
23:47
gim has quit ["bonne nuit les geek"]
23:47
<
async >
hell, i dont know how to parse arrays
23:47
<
Smerdyakov >
async, I don't believe you that the standard documentation won't show you how to do that.
23:48
<
async >
all the standard documentation assumes you're writing some sort of interpreter or calculator
23:48
<
async >
not a text parser
23:49
<
Smerdyakov >
That should not matter for your understanding of the basic principles.
23:51
<
async >
how would you do an array
23:51
<
async >
which could potentially have sub-arrays
23:52
<
async >
'{' [^ '}']* '}' doesn't work, because it would choke on sub-arrays
23:52
<
async >
you need to tokenize the brackets
23:53
<
async >
but then you gotta work with commas
23:53
<
Smerdyakov >
Do you understand how to parse any grammar that includes strings of unbounded size? I.e., simple lists, etc..
23:53
<
Smerdyakov >
Then read the documentation.
23:53
tyler__ has joined #ocaml
23:53
<
async >
the documentation on lex or yacc?
23:54
<
async >
Smerdyakov: i'f you could tell me something a little more specific then 'read the documentation', that would be most useful
23:54
<
Smerdyakov >
You use recursion in rules to parse recursive grammars.
23:54
<
Smerdyakov >
Does that help?
23:55
<
Smerdyakov >
(This should already be clear from the documentation.)
23:56
<
tyler__ >
evening all, anyone can tell me how to call the constructor of type : type lsystem = { a: string; b: string} please ?
23:56
<
tyler__ >
just cant find it in many courses that Ive read
23:57
<
kinners >
tyler__: let bla = {a="foo"; b="bar"};;
23:58
<
simon- >
tyler__, ocaml automatically determines the type
23:59
<
simon- >
hey, did you guys see microsoft's attempt at duplicating ocaml into its .net platform?