middayc_ has quit ["ChatZilla 0.9.85 [Firefox 3.5.5/20091102152451]"]
middayc has quit [Connection timed out]
shr3kst3r has quit [Remote closed the connection]
ikaros has joined #ocaml
ikaros has quit [Read error: 54 (Connection reset by peer)]
shr3kst3r has joined #ocaml
Pimm has joined #ocaml
micrun has quit [Remote closed the connection]
thrasibule has quit [Read error: 110 (Connection timed out)]
sysop_fb has quit []
BigJ2 has quit [Client Quit]
trav has joined #ocaml
Pimm has quit [Read error: 110 (Connection timed out)]
<trav>
I have two projects that should stay separate but one uses the other and neither is installed via ocamlfind. How do I get the higher level one to use the lower level one using OCamlMakefile? I have set the lower one to build byte code and native code libraries and I've set the upper one to use the lower one as a LIBDIR and a LIB but I still get "unbound type constructor" errors.
diml has quit [leguin.freenode.net irc.freenode.net]
<c0m>
so on first iteration of interp ... it see's a rec call with d as first param and everythign after it as a term
<c0m>
so rec (s, t) becomes matched to d and fun n -> if ..... respectively
<c0m>
so i need to substitute the term for every occurrence of d in the actual term
<c0m>
BUT the actual term contains d too
<c0m>
so when i substitute, d gets put in
<c0m>
so it seems to parse recursive calls correctly except for the last substitution it makes because the d (from the original parsed string) is still in there
<c0m>
does that make sense?
ygrek has quit [Remote closed the connection]
<orbitz>
i don't get why your parsing of that string produces that output
<orbitz>
oh, you'r eocmpletley replacing the 'd' term?
<c0m>
yes
ygrek has joined #ocaml
<c0m>
so it replaces it correctly
<orbitz>
how do you decide to stop replacin the d term then because it's recurisve
<c0m>
because there is only 1 occurence of it
<c0m>
*occurrence
<c0m>
so it only replaces it once
<c0m>
but the term contains d too
<orbitz>
i don't see why you wan tot replace it
<mrvn>
you can't. That is the point of recursion
<orbitz>
indeed
<c0m>
i know
<c0m>
but he said that any ID terms left in the string is not allowed
<c0m>
because it is an unbound identifier
<orbitz>
that makes no sense for recursion
<c0m>
which is why i'm having a bit of difficulty
<orbitz>
implement it how you think it shoudl be, and then work on if his instructions make more sense
<c0m>
using natural semantics to determine how to parse strings
<orbitz>
how do you handle parameters to function swithout ID?
<orbitz>
which part says you can' hae any ID's?
<c0m>
Notice that terms of the form ID x can appear whenever x is a formal parameter, but we never need to evaluate such terms, because they should always be replaced by substitution before we evaluate the function body. Any ID x term that does remain in the function body at the time of evaluation is an unbound identifier; in this case the evaluation is stuck and you need to return an ERROR term.
<c0m>
so on the first iteration of substitution, there is going to be the unbound term in there :(
<orbitz>
so he is saying to do replacements in substr, not parestr
<c0m>
yes
<orbitz>
which is not what you are doing
<c0m>
we are to implement substr and parsestr
<c0m>
err substr and interp
<c0m>
yes i am
<c0m>
REC (s, t) -> interp (subst t s t) // Rule (11)
<orbitz>
substr is a sepreate step isn't it?
<c0m>
separate how
<c0m>
we're supposed to implement both of them at the same time as we go along with each new rule
<orbitz>
the peice you pasted appears to be just for fun terms
<orbitz>
he covers rec terms rifht after that
<orbitz>
did you read it?
<c0m>
yes
<c0m>
implemented it as he specified
<c0m>
The rule for evaluating a recursive term is amazingly simple. We just evaluate the body of the term, where all free occurrences of the recursively defined identifier are replaced by the entire rec term.
<c0m>
which is what i pasted above
<c0m>
REC (s, t) -> interp (subst t s t) // Rule (11)
<orbitz>
yes he says to evaluate it
<orbitz>
as in, do the work
<c0m>
which is interp
<orbitz>
not produce a new AST
<orbitz>
in his example he shows teh evaluation of each recursive call
<c0m>
hmm
struktured has quit [Read error: 110 (Connection timed out)]
<c0m>
i thought interp mean evaluate
<c0m>
*meant
<orbitz>
it does...
<orbitz>
evaluate means do work...
munga_ has quit [Read error: 110 (Connection timed out)]
<orbitz>
evaluatign 3 + 2 is 5
<c0m>
so then where am i wrng?
<c0m>
i interp the substituted result
<c0m>
of which contains the unbound identifier
ulfdoz has joined #ocaml
munga_ has joined #ocaml
<orbitz>
you aren't evaluating anythign you'r ejust subsituting
<c0m>
but interp is a recursive function
<c0m>
which does the evaluation
<orbitz>
The examle you posted shows that you are just replacing 'd' with teh defintion of d without actually doing any evaluation
<c0m>
i guess i'm confused on how i'm supposed to evaluate it then
<c0m>
doesn't evaluation => interp'ing the result
<c0m>
=> being imply
<orbitz>
yes, which means you should get a number at the end
<orbitz>
not a term
<c0m>
right
<orbitz>
unless it retursn a function
<c0m>
but i commented it out
<c0m>
so it stops with the end result
<c0m>
but when i put a number in, interpreting it gives unbound identifier error because of that ID "d" in there
<orbitz>
d is bound though
<orbitz>
it's recurisve
<c0m>
so what do you suggest i do
<c0m>
if interp'ing it isn't the answer
<orbitz>
it ist he answer you just aren'te evaluting it
<orbitz>
if you call d with 5
<orbitz>
you ened to evaluate calling d with 4
* c0m
ponders
<c0m>
not sure how to do that
<c0m>
there must be something i'm misunderstanding
<c0m>
or some kind of mental block
<orbitz>
pred n -> n - 1 right?
<c0m>
btw thanks for helping me and sparing me your time!
<c0m>
correct
<c0m>
if 0, returns 0
<orbitz>
so if you see d (pred n)
<orbitz>
then you evalaute pred n
<orbitz>
and call d with it
<c0m>
it is though
<c0m>
(ID "d",APP (PRED,ID "n"))
<c0m>
at the end
Pimm has joined #ocaml
<orbitz>
i'm not sure hwy you are tryign to do any subsitution in teh paste you did
<orbitz>
you don't have any value of n
<orbitz>
so all you can say is you have a recursive funciton
<c0m>
n is th efunction value
<c0m>
interp (parsestr "(rec d -> fun n -> if iszero n thn 0 else succ (succ (d (pred n)))) #37")
<orbitz>
teh fucntion value?
<c0m>
sorry, function param
<c0m>
fun n
<orbitz>
my parser-fu is not strong enough to explain to you what you are doing wrong
<c0m>
:(
<c0m>
ty for trying
<c0m>
really appreciate it
Alpounet has joined #ocaml
thrasibule has joined #ocaml
thrasibule has quit [Read error: 60 (Operation timed out)]
thrasibule has joined #ocaml
<mrvn>
You need to convert the inner d to a reference to the whole. Whatever that translates to in your framework.
c0m_ has joined #ocaml
c0m_ has quit [Read error: 104 (Connection reset by peer)]
c0m_ has joined #ocaml
crooter_afk has joined #ocaml
c0m__ has joined #ocaml
crooter_afk is now known as crooter
c0m has quit [Read error: 110 (Connection timed out)]
ikaros_ has joined #ocaml
ikaros has quit [Read error: 60 (Operation timed out)]
c0m_ has quit [Read error: 110 (Connection timed out)]
tmaedaZ is now known as tmaeda
c0m has joined #ocaml
willb1 has joined #ocaml
willb1 has left #ocaml []
tmaeda is now known as tmaedaZ
c0m has quit [Read error: 104 (Connection reset by peer)]
c0m has joined #ocaml
Smerdyakov has joined #ocaml
c0m__ has quit [Read error: 110 (Connection timed out)]
Ori_B_ is now known as Ori_B
Associat0r has joined #ocaml
Associat0r has quit [Remote closed the connection]
tmaedaZ is now known as tmaeda
ccasin has quit ["Leaving"]
c0m has quit [Read error: 110 (Connection timed out)]
begonzo has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
begonzo has quit [Remote closed the connection]
tmaeda is now known as tmaedaZ
Amorphous has quit [Read error: 60 (Operation timed out)]
tmaedaZ is now known as tmaeda
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]
Amorphous has joined #ocaml
tmaeda is now known as tmaedaZ
munga_ has quit [Read error: 113 (No route to host)]
thrasibule has joined #ocaml
thrasibule has quit [Read error: 131 (Connection reset by peer)]
thrasibule_ has quit [Read error: 104 (Connection reset by peer)]
thrasibule has joined #ocaml
_zack has quit ["Leaving."]
ulfdoz has quit [Read error: 110 (Connection timed out)]
Xteven has joined #ocaml
<Xteven>
hi
<Xteven>
I wonder if someone could explain me what I'm doing wrong
<Xteven>
I have a function which expects something of type instr
<Xteven>
This expression has type (Cil.lhost * Cil.offset) * Cil.exp * Cil.location
<Xteven>
but is here used with type Cil.instr
<Xteven>
when I look at type instr though: type instr = | Set of lval * exp * location
<Smerdyakov>
Well, the error message seems pretty clear. I'm guessing you didn't include an explicit type annotation for the function argument. Am I right?
<Xteven>
with type lval = lhost * offset
<flux>
for one, it needs a constructor, so it cannot be the same type
<Xteven>
a constructor ?
<flux>
try: Set ((host, offset), exp, location)
<flux>
possibly Cil.Set
<Smerdyakov>
Xteven, if you don't know what a constructor is, you might want to read an OCaml tutorial.
<Xteven>
maybe I should
<Xteven>
Cil.Set doesn't exist it seems
<Xteven>
how can you tell in this case that I need a constructor ?
<flux>
xteven, that particular line you just quoted indicated that the module must provide constructor Set
<Xteven>
hm
shiram has joined #ocaml
<flux>
| ConstructorNameHere
<Xteven>
ok
ikaros_ has quit ["Leave the magic to Houdini"]
<Xteven>
I thought the | was just to enumerate some possible subtypes
<flux>
yes, but the name is important
<Xteven>
now it works
<Xteven>
ok thx
<flux>
type a = A of string | B of string
<flux>
happy C-parsing
<Xteven>
I just read the documentation wrong I guess, I'll make note of it
<Smerdyakov>
But, please, don't keep trying to use CIL without having a basic understanding of OCaml.
<Xteven>
thx :)
<Xteven>
flux: you use CIL too ?
<Xteven>
Smerdyakov: hmm ok
<flux>
no. I've taken a look at it, not even used it.
<Xteven>
I thought I'd get the hang of ocaml while I learn CIL
<Xteven>
but that doesn't seem like a good approach
<Xteven>
cann you recommand a good book to learn OCaml ?
<flux>
"introduction to objective caml" is one that's available online, apparently it's decent
<Xteven>
ok thx
Pimm has quit [Remote closed the connection]
Pimm has joined #ocaml
Snark has quit ["Ex-Chat"]
c0m has joined #ocaml
Associat0r has joined #ocaml
Pimm has quit [Read error: 60 (Operation timed out)]
ttamttam has joined #ocaml
Pimm has joined #ocaml
ulfdoz has joined #ocaml
<thelema>
ok, I keep getting an error where GCC is looking for batteries.a when I try to native compile anything with aaa
<thelema>
a known problem of ocaml 3.11.1?
shiram has quit [Read error: 110 (Connection timed out)]
<flux>
doesn't libraries usually come with a .a -file?
<flux>
s/does/do/
<thelema>
my process produces a .cma and a cmxa
<thelema>
I dunno where I should get a .a
ygrek has quit [Remote closed the connection]
<flux>
well, ls -l `ocamlfind query extlib`/*.a says for example extlib comes with an .a-file
<thelema>
hmm, I wonder why noone using aaa has reported any problem with this...
<flux>
maybe they don't compile natively
<thelema>
could be.
<Alpounet>
indeed
<thelema>
I guess I'm re-releasing. I should really find a nice way to automate this release process
<Alpounet>
is it that "un-automatisable" ?
<thelema>
It shouldn't be. I just don't really know what the best process would be. Maybe I should just let github produce an archive of the current tree.
<thelema>
I've been copying my checked out copy and removing the .git folder
<flux>
you should have a top-level make target "make release" that asks git for the contents and puts them to an archive
<flux>
possibly with a smoke test to that resulting archive..
<thelema>
Hmmm...
<thelema>
it would check out from my tree to another directory, or to a subdirectory?
<flux>
possibly to a new directory in /tmp
boost has joined #ocaml
<thelema>
wow, an ocaml segfault, and almost certainly not my fault...
<thelema>
of course we'll see about that
<thelema>
Program received signal SIGSEGV, Segmentation fault.
<thelema>
0x00000000005496e7 in caml_fl_allocate ()
slash_ has quit [Client Quit]
Smerdyakov has quit ["Leaving"]
munga_ has joined #ocaml
<thelema>
it's odd - it looks like my program gets started, and if it needs to GC, it goes off into an finite loop and then a segfault
<thelema>
I take that back, it's not doing that...
<thelema>
any omake experts here?
ttamttam has quit ["Leaving."]
thrasibule has quit [Read error: 110 (Connection timed out)]
mfk has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
ulgen has joined #ocaml
ulgen has quit [Client Quit]
mfk has quit ["ERC Version 5.3 (IRC client for Emacs)"]
_unK has quit [Remote closed the connection]
Pimm has quit [Read error: 104 (Connection reset by peer)]
Pimm has joined #ocaml
albacker has quit ["_"]
middayc_ has joined #ocaml
tmaedaZ is now known as tmaeda
Pimm has quit [Read error: 60 (Operation timed out)]