--*- M2 -*-

-- Date: Thu, 07 Dec 2006 10:37:58 -0600
-- From: Anton Leykin <leykin@ima.umn.edu>
-- To: Michael Stillman <mike@math.cornell.edu>, Dan Grayson <dan@math.uiuc.edu>
-- Cc: Nobuki Takayama <takayama@math.kobe-u.ac.jp>
-- Subject: "read" bug
-- 
-- Hi Dan&Mike,
-- 
-- Together with Nobuki we ran into a curious problem trying to establish an
-- interface between M2 and asir. It might take a long time for you to
-- replicate the error, so let me summarize what happens. Given a freshly
-- created string "tempbuffer" and a (good old) in-out "F" created with
-- "openInOut openListener ..."  the following lines

      F = openInOut openListener "$"
      -- now do, in another M2, this:
      --    "$localhost" << "hi there"
      tempbuffer = "abcde abcde abcde abcde abcde abcde abcde abcde abcde abcde"
      << "b1 = \"" << tempbuffer << "\"" << endl
      isReady F
      newstring = read F
      << "newstring = \"" << newstring << "\"" << endl
      << "b2 = \"" << tempbuffer << "\"" << endl

-- (sometimes!) show that the "tempbuffer" is mutilated by the "read".  More
-- precisely, it is true that substring(b2,0,#newstring) == newstring
-- 
-- Any quick ideas?
-- Cheers,
-- --Anton
-- 
