caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [Batteries or Camlp4] Functionaly updating several fields in an object
@ 2012-10-23 12:24 Ivan Gotovchits
  2012-10-23 13:30 ` Gabriel Scherer
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Gotovchits @ 2012-10-23 12:24 UTC (permalink / raw)
  To: caml-list


I do not know whether the following behaviour is a bug or a feature, so
I've decided to consult with a community.

Given a simple definition:

let create ()  = 
object
  val a = []
  val b = []
  method step = {< a = a; b = b; >}
end

when compiling using batteries extensions:

ocamlfind ocamlc -c -package batteries.syntax -package lablgtk2
-package lablgtk2.init -package oUnit -package threads -package uuidm
-syntax camlp4o -thread -package batteries -syntax camlp4o -I +gsl -I
+res -I +xml-light -I +lablgtk2 -I gui -o gui/bug.cmo gui/bug.ml

I'm receiving the following error:
File "gui/bug.ml", line 7, characters 10-11:
Warning S: this expression should have type unit.
File "gui/bug.ml", line 8, characters 6-11:
Error: This expression has type bool but an expression was expected of type
         'a list

It seems that compilet thinks that something like this:
«a = begin a; b = b end».

After disabling syntax extension everything is ok. 

So the questions:
1) Is this a bug? If not, then how to overcome this unwanted behaviour?
2) If this is a bug? What must be blamed: camlp4 or Batteries?


Thanks in advance, for any comments!

P.S. My setup:
OS: Debian Squeeze 6.0.5
Objective Caml: 3.11.2
Batteries: 1.2.2-1




-- 
         (__) 
         (oo) 
   /------\/ 
  / |    ||   
 *  /\---/\ 
    ~~   ~~   
...."Have you mooed today?"...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-23 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-23 12:24 [Caml-list] [Batteries or Camlp4] Functionaly updating several fields in an object Ivan Gotovchits
2012-10-23 13:30 ` Gabriel Scherer
2012-10-23 13:57   ` Ivan Gotovchits
2012-10-23 14:03     ` Edgar Friendly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).