fn tyi (w :&World, x :Q) -> Ret { let x = input_stream_designator (w, x)?; if let Node::Stream(s) = &mut *x.clone().lock().unwrap() { if let Some(read) = &s.read { if let Some(la) = s.clone().lookahead { s.lookahead = None; return Ok(la.clone()) }}} flush (w, x.clone())?; let buf = &mut[0 as u8]; // Isn't this beautiful? let r = { if let Node::Stream(s) = &mut *x.clone().lock().unwrap() { Some (if let Some(read) = &s.read { Some (read.lock().unwrap().read(buf)) } else { None }) } else { None }}; match r { Some(Some(Ok(1))) => Ok(makchar (w, buf[0] as char)), Some(Some(Ok(0))) => Ok(w.u.nil.clone()), Some(Some(_)) => error (w, "I/O Error", x.clone()), Some(None) => error (w, "Stream not fit for input", x.clone()), None => error (w, "Not a stream", x.clone()) }}