Skip to content

Commit 9e9f588

Browse files
committed
Removed leftover "data", allow multiple outputs
The "data" variable appears to be redundant #63. Now it just has the side effect of supressing multiple outputs.
1 parent ed8a6e9 commit 9e9f588

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/IfSharp.Kernel/Kernel.fs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ type IfSharpKernel(connectionInformation : ConnectionInformation) =
4141
let shellSocketURL =String.Format("{0}://{1}:{2}", connectionInformation.transport, connectionInformation.ip, connectionInformation.shell_port)
4242
do shellSocket.Bind(shellSocketURL)
4343

44-
let data = new List<BinaryOutput>()
4544
let payload = new List<Payload>()
4645
let compiler = FsCompiler(FileInfo(".").FullName)
4746
let mutable executionCount = 0
@@ -216,9 +215,7 @@ type IfSharpKernel(connectionInformation : ConnectionInformation) =
216215
sendMessage shellSocket msg "kernel_info_reply" content
217216

218217
/// Sends display data information immediately
219-
let sendDisplayData (contentType) (displayItem) (messageType) =
220-
data.Add( { ContentType = contentType; Data = displayItem } )
221-
218+
let sendDisplayData (contentType) (displayItem) (messageType) =
222219
if lastMessage.IsSome then
223220

224221
let d = Dictionary<string,obj>()
@@ -266,7 +263,6 @@ type IfSharpKernel(connectionInformation : ConnectionInformation) =
266263
// clear some state
267264
sbOut.Clear() |> ignore
268265
sbErr.Clear() |> ignore
269-
data.Clear()
270266
payload.Clear()
271267

272268
// only increment if we are not silent
@@ -314,17 +310,16 @@ type IfSharpKernel(connectionInformation : ConnectionInformation) =
314310

315311
// send all the data
316312
if not <| content.silent then
317-
if data.Count = 0 then
318-
let lastExpression = GetLastExpression()
319-
match lastExpression with
320-
| Some(it) ->
313+
let lastExpression = GetLastExpression()
314+
match lastExpression with
315+
| Some(it) ->
321316

322-
let printer = Printers.findDisplayPrinter(it.ReflectionType)
323-
let (_, callback) = printer
324-
let callbackValue = callback(it.ReflectionValue)
325-
sendDisplayData callbackValue.ContentType callbackValue.Data "pyout"
317+
let printer = Printers.findDisplayPrinter(it.ReflectionType)
318+
let (_, callback) = printer
319+
let callbackValue = callback(it.ReflectionValue)
320+
sendDisplayData callbackValue.ContentType callbackValue.Data "pyout"
326321

327-
| None -> ()
322+
| None -> ()
328323

329324
// we are now idle
330325
sendStateIdle msg

0 commit comments

Comments
 (0)