Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8945417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:14:30+00:00 2026-06-15T12:14:30+00:00

I was wondering, is there an equivalent of python’s pass expression? The idea is

  • 0

I was wondering, is there an equivalent of python’s pass expression? The idea is to write method signatures without implementations and compiling them just to type-check those signatures for some library prototyping. I was able to kind of simulate such behavior using this:

def pass[A]:A = {throw new Exception("pass"); (new Object()).asInstanceOf[A]}

now when i write:

def foo():Int = bar()
def bar() = pass[Int]

it works(it typechecks but runtime explodes, which is fine), but my implementation doesn’t feel right (for example the usage of java.lang.Object()). Is there better way to simulate such behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:14:31+00:00Added an answer on June 15, 2026 at 12:14 pm

    In Scala 2.10, there is the ??? method in Predef.

    scala> ???
    scala.NotImplementedError: an implementation is missing
      at scala.Predef$.$qmark$qmark$qmark(Predef.scala:252)
      ...
    

    In 2.9, you can define your own one like this:

    def ???[A]:A = throw new Exception("not implemented")
    

    If you use this version without an explicit type paramter, A will be inferred to be Nothing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering, is there a Python equivalent to Apache commons' PropertyUtilsBean? Edit: For
I wondering is there an equivalent of this feature from play framework http://www.playframework.org/documentation/2.0/JavaAsync Basicly
Came across something like this today, and was wondering if there was an equivalent
Just wondering... is there a PHP equivalent to Perl's Taint Mode? I don't think
Is there an equivalent in Java for Python's bisect module ? With Python's bisect
I'm just wondering if there is a C# equivilent for this python code. I
I am developping a WPF application. I am wondering if there is an equivalent
I'm wondering if there's an HTML/JS equivalent to LINQPad, really. Something that I could
Just wondering, is there any equivalent in VBA to VB .NET's PadLeft and PadRight
Possible Duplicate: LINQ equivalent of foreach for IEnumerable<T> I'm wondering whether there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.