<dozer>
ok - I've figured out what the underlying cause of my shift/reduce conflict is
<dozer>
it's to do with the order / precidence of different productions
<dozer>
any pointers about how to re-write a grammar to fix this?
Schmurtz has quit ["Plouf !"]
<dozer>
giving up for the night
_fab has quit [Remote closed the connection]
slipstream-- has joined #ocaml
slipstream has quit [Connection timed out]
pango_ has joined #ocaml
pango has quit [Read error: 145 (Connection timed out)]
khaladan has quit [Read error: 104 (Connection reset by peer)]
<lispy>
dozer: i can't think of any advice off the top of my head, but in the past i found the bison/yacc manual to be helpful with shift/reduce problems
<lispy>
of course, if you're not using bison ymmv
<mikeX>
is there a way to pattern match functions?
mikeX has quit [""zzZzz""]
KrispyKringle is now known as Poopsmith
Skal has joined #ocaml
Smerdyakov has quit ["Leaving"]
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
Banana has joined #ocaml
srle has joined #ocaml
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
m3ga has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
<srle>
hi
<srle>
can somebody tell me the difference between: '#load' and 'open'
<srle>
anybody here?
<pango>
open imports the visible symbols of a module in the current namespace
<pango>
it's just a convenience to avoid prefixing symbols with module name
<srle>
pango : and #load?
<srle>
it is like #include in c?
<pango>
#load loads a module in current process
<pango>
no, like all # commands, it's specific to the interpreter
<pango>
you don't use #load in compiled programs, you link modules instead
<srle>
so, when I want to use operators (like */ from Num) I have to do what?
<srle>
I have to 'open Num'.
<srle>
am I right?
<pango>
start the interpreter with ocaml nums.cma, or just ocaml then use #load "nums.cma" ;; later
<pango>
then either prefix symbols with Num., or use open Num as a shortcut
<pango>
# Num.Int 5 ;;
<pango>
- : Num.num = Num.Int 5
<pango>
# open Num ;;
<pango>
# Int 5 ;;
<pango>
- : Num.num = Int 5
<srle>
pango : tnx
<pango>
np
srle has left #ocaml []
<dozer>
I'm having trouble writing a parser using ocamlyacc and friends
<dozer>
when I parse some text, I get a syntax error
srle has joined #ocaml
<srle>
ih
<srle>
hi
<dozer>
how can I get it to print out more information?
<srle>
does ocaml have ability to run at the same time compiled and interpreted modules.
<srle>
interpreted -> bytecode
<pango>
compiled programs do not contain any interpreter, so I'd probably say no; unless the interpreter can load compiled modules, but I'm not aware it can...
<pango>
(or that the bytecode runtime can load compiled modules)
<srle>
pango : i know that lisp has that ability, it seemed logicat that ocaml can do the same
<pango>
why logical ?
<pango>
ocaml and lisp are quite different beasts
<dozer>
where can I find documentation on Parsing.yyparse?
<pango>
srle: not to mention mixing bytecode and native modules is implementation dependant rather than language dependant
Skal has quit [Remote closed the connection]
m3ga has left #ocaml []
<pango>
srle: lisp environment is built around the interpreter, ocaml environment is built around the two compilers, the interpreter being just a read-eval-print loop tackled on top of the bytecode compiler
<dozer>
where can I find documentation on print_newline?
<dozer>
I can't find it in either the core library or standard library pages
<zmdkrbou>
at the bottom of the page
<zmdkrbou>
List of modules
<zmdkrbou>
then Pervasives
<dozer>
thanks - found it now
dozer has quit [Remote closed the connection]
ski has quit [Read error: 104 (Connection reset by peer)]
ski has joined #ocaml
dozer has joined #ocaml
zigong has joined #ocaml
zigong has quit [Remote closed the connection]
zigong has joined #ocaml
zigong has quit ["using sirc version 2.211+KSIRC/1.3.12"]
Skal has joined #ocaml
SKerjean has joined #ocaml
<SKerjean>
hello everybody
<dozer>
hi
<SKerjean>
i am recompiling ocaml 3.09.1 on beos
ski_ has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
zigong has joined #ocaml
<dozer>
multi-file builds are confusing me
<SKerjean>
dozer have you questions about it ?
<dozer>
if I have datatypes A, B that I want to define in a file and then a main.ml that will use them, then what do I put in AB.mli and what goes in AB.ml?
<Smerdyakov>
dozer, you use a _value_ 'a' in Main, not a type.
<Smerdyakov>
Same for 'b'.
<Smerdyakov>
ML has separate namespaces for types and valuesd.
<dozer>
That sort of makes sense - so how do I make an instantiation of b?
<Smerdyakov>
You can't. It's an abstract type.
<Smerdyakov>
(By your own design of Ab's signature)
<dozer>
if I changed it to b=string, then how would I instantiate it? and would b=string go in the mli or the ml file?
<Smerdyakov>
There is no concept of "instantiating a type" in OCaml. It sounds like you should read the tutorial in the manual.
<vodka-goo>
then any string is a b
<vodka-goo>
you don't need to tell anything about the target type
<vodka-goo>
["bla"] will be a perfect Ab.a
<dozer>
ah - perhaps that's where I am getting confused - too much Java early strict typing thoughts
<Smerdyakov>
If anything, ML has stricter typing than Java.
<Smerdyakov>
Just less nominal
<vodka-goo>
dozer: my students keep trying to put type annotations too
<dozer>
so is type a = string distinguishable from type b = string?
<Smerdyakov>
dozer, what do you mean?
<dozer>
well, I assume that "foo" is both an a and a b in this case?
<vodka-goo>
dozer: nope
<Smerdyakov>
dozer, do you know typedef in C?
<dozer>
yes
<vodka-goo>
(and yes for the second question)
<Smerdyakov>
dozer, type synonyms in ML are like typedef.
<dozer>
ok - *thinks*
<dozer>
let's say I have a type variable and a type constant. I want to build expressions that are lists of (variable | constant) and I want to perform different actions when I see variable vs constant.
<dozer>
and I want to be able to associate a string with each variable and a string with each constant
<Smerdyakov>
dozer, honestly, have you yet read through an OCaml tutorial?
<vodka-goo>
dozer: then you use a sum type with alternatives = Const of string | Var of string
<dozer>
vodka-goo: ah - so I tag things at the level of the alternatives not at the elvel of const and var
<Smerdyakov>
vodka-goo, do you think you are helping by giving ad-hoc explanations instead of pointing to well-though-out written material?
<vodka-goo>
actually, yes
<dozer>
I've read through the tutorial, and worked through the first few chapters
<vodka-goo>
I think fast startup motivates people to go further
<dozer>
but this stuff about types wasn't explicitly written in there
<dozer>
that I noticed
<Smerdyakov>
dozer, my approach to learning languages is to read the whole tutorial before writing any code not suggested in exercises (where you know you've already been shown every tool you need).
<Smerdyakov>
dozer, you should read the whole thing before attempting your own program ideas.
<dozer>
but the tutorial doesn't contain variations on a theme, or common misunderstanings and what went wrong, which is how people learn the boundaries of a language
<dozer>
you only learn a language by trying lots of things that are in the ballpark and learning what is right and what's wrong
<vodka-goo>
not only, but at least that's a big part of it
<vodka-goo>
dozer: I didn't understand your question, btw
<Smerdyakov>
dozer, I don't agree. You learn that way _after_ you have a sufficiently accurate roadmap of the language design, so you know what to look up when you get stuck.
<vodka-goo>
when I was taught Coq, I'm glad they didn't show me the complete ICC theory at first
<Smerdyakov>
dozer, why are you using type synonyms, anyway, if you haven't read anything that introduced them?
<Smerdyakov>
vodka-goo, and that's not the route that Coq'Art takes, either; they provide exercises at each stage that don't require knowledge of later topics.
<vodka-goo>
so you don't read the whole tutorial before trying your own designs
<dozer>
Smerdyakov: because I missunderstood about tagging things at alternatives
<Smerdyakov>
dozer, it seems that you're trying to learn syntax by experimentation, which never makes sense.
<dozer>
Smerdyakov: at the risk of getting off-topic, it's how we all learned natural language - there isn't any formal grammar for those to read
<Smerdyakov>
dozer, software development is a very different thing.
<dylan>
Not everyone is a software engineer. Just like not everyone writes in prose?
<Smerdyakov>
If you're not interested in how to write software effectively, then I guess I don't have much common ground to offer advice on OCaml.
<dylan>
I learned ocaml's syntax by poking the toplevel and reading the standard library, mostly.
<Smerdyakov>
I think that is a kind of misguided lazyness that uniformly makes things harder for you.
<dylan>
I haven't found a hard problem.
<Smerdyakov>
But you've found small problems like this that you wouldn't otherwise have encountered.
* Smerdyakov
has to leave.
bd_ has joined #ocaml
<dylan>
I can't really think of one. I found it harder learning ocaml from the manual than from the source code.
<dozer>
sorry - have I unduely ryled someone?
<dylan>
dozer: No, it's pretty normal for Smerdyakov to say funny things about the right way to learn languages, etc. He's got some pretty strong opinions.
<dozer>
fine
<dozer>
I've taught a few languages for a while to green students, and can't say I agree with him, except for the aspurgis students who you just give the ast and evaluation semantics to
<dozer>
each to his own
<dylan>
I remember when I learned highschool algebra, if I was given too much of an explaination I'd have trouble understanding it.
<dozer>
I think if I'd been exposed to commutative rings to describe operator precidence so I knew how to read "x = a b + cd" I would have run away screaming
<dylan>
I learned operator precedense from perl, actually. :-)
<dozer>
hehe, but had been using it for years before in algebra classes
<dozer>
just checking - "a ; b; c" evaluates to c, after executing a and b and c in order?
<dylan>
Yes -- and a and b should be of type unit.
<dozer>
thx
Kerjean has joined #ocaml
vodka-goo has quit ["Connection reset by by pear"]
pango has quit ["Leaving"]
pango has joined #ocaml
<dozer>
dylan: reading the standard libs is helpful
Kerjean is now known as Anarchos
Anarchos has quit [Client Quit]
Kerjean has joined #ocaml
Kerjean is now known as Anarchos
Bigb[a]ng is now known as Bigbang
Skal has joined #ocaml
<Anarchos>
i am just finishing the port of ocaml 3.09.1 to BeOS
<Anarchos>
<Kerjean> it is fully functional except for some missing unix functions (chmod, nice, socketpair, etc)
<Anarchos>
Where do i submit it ?
vodka-goo has joined #ocaml
mikeX has joined #ocaml
<Anarchos>
I have a problem : with ocaml 3.06 i had no problem to use caml_copy_string (interface between C and OCaml) but with ocaml 3.09 my programs tell me that the symbol is an 'undefined reference'
<vodka-goo>
there may be some a #define for getting back the old namings
<vodka-goo>
#define CAML_NAME_SPACE
<vodka-goo>
(before your #includes)
<Anarchos>
what is the new naming convention ?
<vodka-goo>
caml_copy_string is the good one, if you put that #define
<vodka-goo>
I dunno the details, I'm not the wrapper of the team ;)
<vodka-goo>
ppsmimou: here ?
<vodka-goo>
Anarchos: but trust me, ocaml-vorbis does like this, this is a good choice ;)
<vodka-goo>
samuel is now experimented
zigong has joined #ocaml
<Anarchos>
ok i will try it
<dozer>
yay! got my parser/lexer building an AST
<Anarchos>
at last :)
<dozer>
yeah - only like 12 hours of blood, sweat and tears
<dozer>
they say your 1st one is the hardest :-)
<vodka-goo>
for parser/lexer, that's probably true
alch` has quit [Read error: 110 (Connection timed out)]
kral has joined #ocaml
smimou has joined #ocaml
<Anarchos>
i have a pretty large project with caml and C code. When i compile, it fails on an ocamlmktop command, apparently the funcitons of libcamlrun.a aren't linked against my code
vodka-goo has quit ["Connection reset by by pear"]
dozer has quit [Remote closed the connection]
bohanlon has joined #ocaml
<Anarchos>
if i do "ocamlmktop -verbose ..."
<Anarchos>
i see a -lcamlrun option in the gcc line
<Anarchos>
but i don't know if this is correct since i don't see the path to libcamlrun.a in my $PATH environment variable
<dylan>
err, isn't $PATH for executables, not libraries?
<Anarchos>
dylan well hmm sure but where do i find the path for the -llib syntax ?
<dylan>
on linux, it's $LD_LIBRARY_PATH, I think
<Anarchos>
$LIBRARY_PATH on beos
<Anarchos>
okay, i don't have the right dir in it
<Anarchos>
i wonder where i shall configure stuff like that. in a .bash_profile file maybe ?
<mikeX>
Anarchos: usually yes, although the use of LD_LIBRARY_PATH seems to be discouraged, I don't know about beos though :/
<Anarchos>
i don't see any problem to use it for BeOS :)
<pango>
someone posted an analysis of what cryptopp is really used for, but I wonder if I could find it again...
<pango>
oups wrong channel ;)
<mikeX>
hahah
<mikeX>
all the same
<pango>
that's just one tab apart ;)
<mikeX>
heh
ski_ is now known as ski
bohanlon has quit ["It is sleepy time for my computer."]
Bigbang is now known as Bigb[a]ng
Revision17 has joined #ocaml
Revision17 has quit [Remote closed the connection]
bohanlon has joined #ocaml
bohanlon has quit [Client Quit]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
__DL__ has quit ["Bye Bye"]
Purice has joined #ocaml
Purice has quit [Client Quit]
alch` has joined #ocaml
kral has quit [""In girum imus nocte et consumimur igni.""]
gim has quit ["bonne nuit"]
Revision17 has joined #ocaml
lispy_ has joined #ocaml
lispy has quit [Read error: 110 (Connection timed out)]