Scala Programming Language
  1. Scala Programming Language
  2. SI-6641

scala-swing should cull its residual references to scala-actors

    Details

      Description

      See: https://issues.scala-lang.org/browse/SI-6640?focusedCommentId=60822&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-60822

      Here there are:

      package scala.swing
      
      import scala.actors._
      
      object SwingWorker {
      
      }
      
      abstract class SwingWorker extends Actor {
        def queue() {
      
        }
      
        def done() {
      
        }
      
        private var _cancelled = false
        def cancelled: Boolean = _cancelled
        def cancelled_=(b: Boolean) { _cancelled = b }
      }
      
      package scala.swing
      
      import scala.actors._
      
      // Dummy to keep ant from recompiling on every run.
      trait SwingActor { }
      

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1603
        Hide
        A. P. Marki added a comment - - edited

        Someone asked a question about Swing on SO so I had to cull old code. The second thing I wrote in Scala was a Scala SwingWorker. I don't know if it's pointless at this point (and maybe that point, too). But I could improve/upgrade it from old Future to new Future.

        git://github.com/som-snytt/scala-swing-support.git

        I was trying to remember whether, when you cull something, you keep it or discard it. Apparently, cull is collect, but a cull is a discard. It's too bad there isn't a collections framework method named cull, perhaps that would somehow work slightly differently from partition. That would be fun. `cull` would return one set, `culls` the other.

        Update: dictionary example: cull the best passages from the poet's work. These examples were culled from the compiler code base.

        Show
        A. P. Marki added a comment - - edited Someone asked a question about Swing on SO so I had to cull old code. The second thing I wrote in Scala was a Scala SwingWorker. I don't know if it's pointless at this point (and maybe that point, too). But I could improve/upgrade it from old Future to new Future. git://github.com/som-snytt/scala-swing-support.git I was trying to remember whether, when you cull something, you keep it or discard it. Apparently, cull is collect, but a cull is a discard. It's too bad there isn't a collections framework method named cull, perhaps that would somehow work slightly differently from partition. That would be fun. `cull` would return one set, `culls` the other. Update: dictionary example: cull the best passages from the poet's work. These examples were culled from the compiler code base.
        Hide
        Jason Zaugg added a comment - - edited

        My interpretation of the word is to "round up and exterminate." I'd code it in a hybrid functional/imperative manner:

        def cull[A](as: Seq[A], cond: A => Boolean, action: A => Unit): Seq[A] =
          val (theUnlucky, theLucky) = as partition cond
          theUnlucky foreach action
          theLucky
        }
        

        Stay tuned for an easier-to-contribute-to incarnation of scala-swing post 2.10.0.

        Show
        Jason Zaugg added a comment - - edited My interpretation of the word is to "round up and exterminate." I'd code it in a hybrid functional/imperative manner: def cull[A](as: Seq[A], cond: A => Boolean, action: A => Unit): Seq[A] = val (theUnlucky, theLucky) = as partition cond theUnlucky foreach action theLucky } Stay tuned for an easier-to-contribute-to incarnation of scala-swing post 2.10.0.
        Hide
        Daniel Sobral added a comment -

        Unless Scala Actors are going to be still around with 2.11, this must be deprecated on 2.10.x.

        As for undocumented, etc, etc, I've found another program using it.

        Show
        Daniel Sobral added a comment - Unless Scala Actors are going to be still around with 2.11, this must be deprecated on 2.10.x. As for undocumented, etc, etc, I've found another program using it.
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1862 https://github.com/scala/scala/pull/1863
        Hide
        Jason Zaugg added a comment -

        Deprecated in 2.10.1, removed in 2.11.0-M2.

        Show
        Jason Zaugg added a comment - Deprecated in 2.10.1, removed in 2.11.0-M2.

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Jason Zaugg
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development