{"id":2433,"date":"2022-08-30T15:24:49","date_gmt":"2022-08-30T15:24:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/12\/problem-about-dsl-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:24:49","modified_gmt":"2022-08-30T15:24:49","slug":"problem-about-dsl-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-dsl-collection-of-common-programming-errors\/","title":{"rendered":"problem about dsl-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fcdaa233771f8678fc6e261bb69446c1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonas<br \/>\nscala interpreter dsl<br \/>\nIs is possible to compile and execute scala code as a string at runtime either in Scala or in Java? My idea is to build a DSL using Scala then let Java programmers use the DSL inside Java. I heard that the class scala.tools.nsc.Interpreter can do something like that, but when I imported it inside my scala file, I got &#8220;object tools is not a member of package scala.&#8221;So could anybody give me a hint?<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/KPUcH.png?s=32&amp;g=1\" \/><br \/>\nMechanical snail<br \/>\nscala syntax dsl syntactic-sugar<br \/>\nIs it possible to have angle brackets in method names , e.g. :class Foo(ind1:Int,ind2:Int){&#8230;} var v = new Foo(1,2) v(1) = 3 \/\/updates ind1 v&lt;1&gt; = 4 \/\/updates ind2The real situation is obviously more complicated than this!!I am trying to provide a convenient user interface.<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/suHvP.jpg?s=32&amp;g=1\" \/><br \/>\nRodrigo<br \/>\nscripting erlang dsl fsm<br \/>\nI am planning a turn based game (a sort of board game), and the backend will probably be done in Erlang. The game logic part seems to be a fit for a hierarchical state machine, but I&#8217;m not sure about how to implement that in Erlang.Maybe I can spawn a separate process with each child fsm, not sure if this would work.Another option would be to embed a scripting language or create a DSL for this purpose.What do you think?Thanks.<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/520b9e3418a19d3e442f5713613ef9b8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMeir Goldenberg<br \/>\nping dsl disconnect<br \/>\nI have a dual-boot machine: Windows 7 and Ubuntu 10.04. The computer is connected directly to the Baudtec modem by a LAN cable. The modem is connected to the phone jack. Under Windows, the internet works without any problems. Under Ubuntu, I set up by using pppoeconf and can get online without a problem. However, after some time (about 15-20 minutes, sometimes less), the internet stops working. That is, I cannot open any website. I can still &#8220;ping 8.8.8.8&#8221;, although &#8220;ping www.google.com&#8221; says &#8220;u<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/039d0df2ad0bdee4c506943c79bf70c3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMichael<br \/>\nc parsing dsl<br \/>\nOne of my programs accepts a commands (like kill foo) at runtime. Think of it as a little domain-specific language. Here are a few examples:kill kill client exitBut also, chained commands are allowed and whitespace is not significant before and after commands, so the following examples are also valid:kill ; say &#8220;that was fun&#8221;kill ; kill ; kill;I have currently implemented this with lex\/yacc (flex\/bison to be specific) and that caused a lot of headache. The lexer very much depends on the c<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/446ee77529ff7fc74c75bcbbbeca1de3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPhilipp Cla\u00dfen<br \/>\ncoffeescript dsl design-by-contract<br \/>\nI consider design-by-contract an useful technique and want to apply it to my coffeescript code.There is contracts.coffee, which looks really nice (like Haskell):id :: (Num) -&gt; Num id = (x) -&gt; xDownside is that it is a language extension. I&#8217;m hesitating because I&#8217;m afraid to trade in trouble with tool support. (Am I too conservative?)Though it really looks great, I would prefer a library solution at the moment. For Ruby, I recently found contracts.ruby, which shares the same elegance but ha<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/63e408bc29491c46e2e1425555ffe36c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nneezer<br \/>\nruby-on-rails-3 capybara dsl minitest<br \/>\nThe readme for Capybara (see Using Capybara with MiniTest::Spec) says that I can do this if I include the module correctly, but it doesn&#8217;t give any illustrative examples of how&#8230; I&#8217;ve tried including the module like this:class MiniTest::Specinclude Capybara::DSL end&#8230; to no avail. I keep getting this error:&lt;main&gt;&#8217;: undefined methodfeature&#8217; for main:Object (NoMethodError)How can I get it to work as it&#8217;s written in the commented-out code?spec\/acceptance\/api\/reward_terms_spec.rb:require &#8220;#{<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9f8f6670ea2f0b00e8b36a2dd5ad9be8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAlessandro Vermeulen<br \/>\nhaskell dsl gadt<br \/>\nCan we transform a GADT without a given constraint on its constructors to a GADT that does have the said constraint? I want to do this because I want to get a deep-embedding of Arrows and do some interesting things with the representation that (for now) seem to require Typeable. (One reason)data DSL a b whereId :: DSL a aComp :: DSL b c -&gt; DSL a b -&gt; DSL a c&#8211; Other constructors for Arrow(Loop,Apply,etc)data DSL2 a b whereId2 :: (Typeable a, Typeable b) =&gt; DSL2 a aComp2<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b52bc71fb15db17f585b912aed45b217?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntibbe<br \/>\nhaskell dsl gadt<br \/>\nIn Type-Safe Observable Sharing in Haskell Andy Gill shows how to recover sharing that existed on the Haskell level, in a DSL. His solution is implemented in the data-reify package. Can this approach be modified to work with GADTs? For example, given this GADT:data Ast e whereIntLit :: Int -&gt; Ast IntAdd :: Ast Int -&gt; Ast Int -&gt; Ast IntBoolLit :: Bool -&gt; Ast BoolIfThenElse :: Ast Bool -&gt; Ast e -&gt; Ast e -&gt; Ast eI&#8217;d like to recover sharing by transforming the above AST totype N<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b5af02e4d05b8d77ecfa3e3259e8b497?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChris Kuklewicz<br \/>\nhaskell metaprogramming dsl<br \/>\nQuasiquotation as described in haskellwiki is shown mostly as useful tool for embedding other languages inside Haskell without messing around with string quotation.Question is: For Haskell itself, how easy it would be to put existing Haskell code through a quasiquoter for the purpose of just replacing tokens and passing the result over to ghc? Perhaps Template Haskell is key here?I have looked for code examples and didn&#8217;t find any. Some EDSLs can benefit from this ability by reducing the size of<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7b3297b0f913d67a251ec08401aca583?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmu is too short<br \/>\nruby parsing dsl treetop<br \/>\nWith the grammar defined as below, why I keep get error while try to access the val method of nodes created by rule key?The error message is(eval):168:in `val&#8217;: undefined local variable or method `key&#8217; for #&lt;Treetop::Runtime::SyntaxNode:0x00000101b1e160&gt; (NameError)The grammar isgrammar Commandrule create_command&#8217;create&#8217; space pair {def valpair.valend}endrule pairkey space? &#8216;=&#8217; space? &#8216;&#8221;&#8216; value &#8216;&#8221;&#8216; {def val{ key.val =&gt; value.val }end}endrule key[A-Za-z_] [A-Za-z0-9_]* {def valkey.to_sym<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a2d6fa736d2c6ca943769b9a79964606?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1201210<br \/>\njava parsing antlr dsl antlrworks<br \/>\nI am creating a parser using ANTLR 3.x that targets java. I have written both parser grammar (for creating Abstract Syntax Tree, AST) and Tree Grammar (for performing operations on AST). Finally, to test both grammar files, I have written a test file in Java.Have a look at the below code,protocol grammargrammar protocol; options {language = Java;output = AST; }tokens{ \/\/imaginary tokens PROT; INITIALP; PROC; TRANSITIONS; } @header { import twoprocess.Configuration; package com.javadude.antlr3.x.<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/246463026004edf9368bf0d5a5a7da88?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1424119<br \/>\njava apache-camel dsl<br \/>\nI have route:from(SU_NAME).choice().when(STATUS_IS_OK).to(&#8220;xslt:xsl\/RemoveNode.xsl&#8221;).split().tokenizeXML(&#8220;Event&#8221;, &#8220;Header&#8221;).to(XP_NAME).otherwise().dynamicRouter(method(router, &#8220;slip&#8221;)).end(); If I remove splitter I have everything working fine, but having it in my route gives me:java.lang.Error: Unresolved compilation problem: The method otherwise() is undefined for the type ExpressionNodeI need splitter to be part of the route, can you help me. I understand that there should be choise ChoiceD<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dd018e3b798487835178cd81c5bd3492?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\niglvzx<br \/>\nnetworking wireless-router dsl<br \/>\nRouter reconfigures PC&#8217;s and they can no longer access the internet via hardwired connection to DSL Modem. Hardware Information:Buffalo Wireless Router\/access point, Model: WZR-HP-G300NH-AP DSL Modem: Generic (actually not sure of manufacture). Service Provider: TOT (Thailand) Laptop-1: Windows XP and Belkin PCMIA Network Card Laptop-2: Windows XP unknown network card &amp; Wifi Laptop-3: Windows 7 unknown network card &amp; WifiOutline of Problem\/actions taken:After a recent power failure the<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5738c02070833b70609a7fe8f0b75eef?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJohn J. Camilleri<br \/>\neclipse-plugin dsl xtext<br \/>\nI&#8217;m developing an Eclipse Plugin with support for my DSL using the Xtext framework. When I try to open a file on my system with the matching file extension .gf &#8211; but which is not in my workspace &#8211; I get the following:0 [main] ERROR org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback &#8211; Was configured with another client or not configured at all. java.lang.IllegalStateException: Was configured with another client or not configured at all.at org.eclipse.xtext.ui.editor.DirtyStateEditorSuppo<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ee472fa8bdc8e0c1c7ad0c1cd6e60e34?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njharvalik<br \/>\ncxf apache-camel dsl pojo<br \/>\nI have problem with proper processing of this route. &lt;camelContext xmlns=&#8221;http:\/\/camel.apache.org\/schema\/spring&#8221;&gt;&lt;route id=&#8221;ws_entry&#8221; streamCache=&#8221;true&#8221; &gt;&lt;from uri=&#8221;cxf:\/\/http:\/\/localhost:8082\/webservices\/incident?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint\/&gt;&lt;to uri=&#8221;file:\/\/target\/inbox&#8221; \/&gt;&lt;to uri=&#8221;bean:incidentProcessor&#8221;\/&gt; &lt;\/route&gt;Processing of InputReportIncident\/OutputReportIncident by FileProcessor throws following exception<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/513d79940a586a121c7a740ffbc6efd7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnils petersohn<br \/>\ngroovy dsl<br \/>\ni am developing a nice little DSL with Groovy.I really like the Command Expression with higher order functions. with little code i can do:timerange = from today to tomorrowthis is actually timerange = from(today).to(tomorrow)but now i would like to do something like this:difference = difference from today to tomorrowwhich should result in something like this:difference = difference(from(today).to(event.start))I always get the error: No such property: from for class: Script1.Here is a test class<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/876615d99453e16a4844675c10c35eec?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTristan<br \/>\nscala jython dsl<br \/>\nI&#8217;m evaluating languages for a computational oriented app that needs an easy embedded scripting language for end users. I have been thinking of using Scala as the main underlying language and Jython for the scripting interface. An appeal of Scala is that I can define methods such as :* for elementwise multiplication of a matrix object and use it with infix syntax a :* b. But :* is not a valid method name in Python. How does Jython deal with this?I would consider using Scala as the scripting l<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2014-01-12 20:26:24. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Jonas scala interpreter dsl Is is possible to compile and execute scala code as a string at runtime either in Scala or in Java? My idea is to build a DSL using Scala then let Java programmers use the DSL inside Java. I heard that the class scala.tools.nsc.Interpreter can do something like that, but when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[],"class_list":["post-2433","post","type-post","status-publish","format-standard","hentry","category-capybara","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2433"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2433\/revisions"}],"predecessor-version":[{"id":8755,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2433\/revisions\/8755"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}