enumerator

    1热度

    1回答

    对不起,如果我不以正确的方式问我的问题。 试图让这一点的Ruby代码工作。我不明白的是如何让底部的点击操作调用yield函数(这是一个交通灯),以便点击将循环访问yield选项。真实的,错误的,错误的将意味着光是红色的,因为它在顶部,而底部的是错误的。我也很难在统计员和收益率之间缠绕我的头脑。 class TrafficLight include Enumerable incl

    0热度

    1回答

    如何返回IEnumerator的SortedDictionary(Of Integer, MyClass) 我有这个。 Dim dictionaryTest As New SortedDictionary(Of Integer, MyClass) Dim enumerator As IEnumerator(Of Integer, MyClass) = dictionaryTest.GetEnum

    2热度

    1回答

    Enum#feed 设置由内e。如果 值未设置的下一产量返回的值,收益回报nil.This值 正在产生后清零。 我试过一个例子,但它不是我认为理解 #feed方法的那个例子。 a = [1,2,3,4].to_enum p a.next #=> 1 a.feed 'foo' p a.next #=> 2 , I expected here 'foo' 谁能给我一个很好的例子,了解如何#f

    0热度

    1回答

    我必须使用枚举器将传入构造函数的float转换为基于浮点值(称为R)的字符串。它看起来是这样的: static void Main(string[] args) { float R = 1; <name of class> <object> = new <name of class> (R); } public class <name of clas

    3热度

    1回答

    我继承Enumerator这样的: class CuadraticPrimeGenerator < Enumerator def initialize(a=1,b=49) super do |y| x = 1 loop do y << x**2 + a*x + b x += 1 end end en

    2热度

    1回答

    当我这样做时,它按预期工作: enum = [1,2,3,4,5].each #=> #<Enumerator: [1, 2, 3, 4, 5]:each> enum.next #=> 1 如果我尝试在Ruby 1.8.7上使用backports的情况下,发生以下事情: require "backports" enum = [1,2,3,4,5].each #=> #<Enumera

    1热度

    2回答

    得到一个枚举我有这样的对象: class Animation { //[...] private SortedList<int,Frame> frames = new SortedList<int,Frame>(); private IDictionaryEnumerator frameEnumerator = null; //[...]

    0热度

    1回答

    的GetEnumerator强制转换为接口失败 没有编译器错误 与邮件索引无穷运行故障 如果我使用结构Word1252直接与无界面它的工作原理 namespace WordEnumerable { public partial class MainWindow : Window { public MainWindow() { Initia

    5热度

    3回答

    我正在尝试使用scalaz iteratee软件包处理恒定空间中的大型压缩文件。我需要对zip文件中的每个文件执行一个长时间运行的过程。这些进程可以(也应该)并行运行。 我创建了一个EnumeratorT,它将每个ZipEntry都膨胀为File对象。签名是这样的: def enumZipFile(f:File):EnumeratorT[IoExceptionOr[IO[File]], IO]

    1热度

    1回答

    我已经写了与阿卡-IO一个简单的socket客户端,从一个套接字服务器消耗的字符串服务器发送的事件广播从演员的消息(发送由\ n分隔的字符串): class SocketClient(endpoint: InetSocketAddress) extends Actor { override def preStart() { IOManager(context.system).c