The Artima Developer Community
Sponsored Link

Programming in Scala Forum
Chapter 18 simulator

2 replies on 1 page. Most recent reply: Dec 21, 2010 10:17 PM by Jim Balter

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
steve short

Posts: 1
Nickname: mandolins
Registered: Dec, 2010

Chapter 18 simulator Posted: Dec 16, 2010 1:38 PM
Reply to this message Reply
Advertisement
Hi, going through the simulator example on chapter 18 page 372 I see you use:

def InverterDelay: Int

why is this not a val or is this reduced to the same code as:

val InverterDelay: Int


Jim Balter

Posts: 13
Nickname: jibal
Registered: Dec, 2010

Re: Chapter 18 simulator Posted: Dec 21, 2010 10:16 PM
Reply to this message Reply
From footnote 2 on page 417:

They are methods so they can be overridden in subclasses. You’ll find out how to do the same thing with vals in Section 20.3.

Jim Balter

Posts: 13
Nickname: jibal
Registered: Dec, 2010

Re: Chapter 18 simulator Posted: Dec 21, 2010 10:17 PM
Reply to this message Reply
(Page 417 of the 2nd edition, that is.)

Flat View: This topic has 2 replies on 1 page
Topic: Page 189 - variable argument list. Common considerations about learning in Previous Topic   Next Topic Topic: pdf page 88 - 2nd edition

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use