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

  • Home
  • SEARCH
  • 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 7433053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:33:19+00:00 2026-05-29T09:33:19+00:00

i am creating a small scala DSL and running into the following problem to

  • 0

i am creating a small scala DSL and running into the following problem to which i dont really have a solution. A small conceptual example of what i want to achieve:

(Compute
 write "hello"
 read 'name
 calc()
 calc()
 write "hello" + 'name
)

the code defining this dsl is roughly this:

Object Compute extends Compute{
  ...
 implicit def str2Message:Message = ...
}
class Compute{
 def write(msg:Message):Compute = ...
 def read(s:Symbol):Compute = ...
 def calc():Compute = { ... }
}

Now the question: how can i get rid of these parenthesis after calc? is it possible? if so, how? just omitting them in the definition does not help because of compilation errors.

  • 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-05-29T09:33:20+00:00Added an answer on May 29, 2026 at 9:33 am

    ok, i think, i found an acceptable solution… i now achieved this possible syntax

     | write "hello"
     | read 'name
     | calc
     | calc
     | write "hello " + 'name 
    

    using an object named “|”, i am able to write nearly the dsl i wanted. normaly, a “;” is needed after calc if its parameterless. The trick here is to accept the DSL-object itself (here, its the “|” on the next line). making this parameter implicit also allows calc as a last statement in this code.
    well, looks like it is definitly not possible to have it the way i want, but this is ok too

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

Sidebar

Related Questions

I am creating small django application which holds some few questions (and answers for
I am creating a small silverlight widget which pronounces a word and highlights each
I'm creating a small code plugin which allows you to do some things with
I am creating a small HTML editor using jQuery. I have created my own
I'm creating a small web page using jquery-ui-1.8 which is having a frameset and
I have started creating small applications in Java using Net-beans, i was trying to
I am creating a small Visual Studio 2010 extension in C# which uses the
I have a task to create a website that'll allow creating small websites, mostely
I am creating a small modal form that is used in Winforms application. It
I am creating a small application that will be deployed on Window. The database

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.