From 6ce6968a81b35d74d225049335b34cb2524208f6 Mon Sep 17 00:00:00 2001 From: Henry Story Date: Fri, 2 Dec 2022 16:29:23 +0100 Subject: [PATCH] Moving to Classes. This does not work --- bin/clean | 1 - bin/compileScalaTrait | 2 +- scala/RDF_Trait.scala | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/clean b/bin/clean index dce94d8..abb6197 100644 --- a/bin/clean +++ b/bin/clean @@ -1,3 +1,2 @@ -find java -name "*.class" | xargs rm find build -name "*.class" | xargs rm find build -name "*.tasty" | xargs rm diff --git a/bin/compileScalaTrait b/bin/compileScalaTrait index 96ed85b..ba2b5ef 100644 --- a/bin/compileScalaTrait +++ b/bin/compileScalaTrait @@ -3,4 +3,4 @@ $SCALA_HOME/bin/scalac -d build -release 17 -explain scala/RDF.scala scala/RDF_Trait.scala # and so this does not run -#$SCALA_HOME/bin/scala -classpath build class_based.run +$SCALA_HOME/bin/scala -classpath build interf_based.run diff --git a/scala/RDF_Trait.scala b/scala/RDF_Trait.scala index 33368c6..ef73bb3 100644 --- a/scala/RDF_Trait.scala +++ b/scala/RDF_Trait.scala @@ -7,10 +7,10 @@ object TraitTypes { trait Node: def value: String - trait Uri extends Node + class Uri(u: String) extends Node: + def value = u - def mkUri(u: String): Uri = - new Uri { def value = u } + def mkUri(u: String): Uri = new Uri(u) } object TraitRDF extends generic.RDF: