caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ivan Gotovchits <ivg@ieee.org>
To: caml-list@inria.fr
Subject: [Caml-list] [Batteries or Camlp4] Functionaly updating several fields in an object
Date: Tue, 23 Oct 2012 16:24:06 +0400	[thread overview]
Message-ID: <877gqhnzq1.fsf@golf.niidar.ru> (raw)


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?"...

             reply	other threads:[~2012-10-23 12:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 12:24 Ivan Gotovchits [this message]
2012-10-23 13:30 ` Gabriel Scherer
2012-10-23 13:57   ` Ivan Gotovchits
2012-10-23 14:03     ` Edgar Friendly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877gqhnzq1.fsf@golf.niidar.ru \
    --to=ivg@ieee.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).