Welcome to the public discussion channel for the Ceylon programming language (https://ceylon-lang.org)
dependabot[bot] on maven
Bump json-smart from 1.3.1 to 1… (compare)
dependabot[bot] on maven
dependabot[bot] on maven
Bump httpclient from 4.3.2 to 4… (compare)
osgi-5
naming is not the cause of the error. It's more a confusing message related to the fact that the osgi dependency resolver is used at some point
./resource/com/example/thing/ROOT/META-INF/MANIFEST.MF
in https://ceylon-lang.org/documentation/1.3/reference/tool/project/
ServiceLoader
can't find it.
CeylonModuleClassLoader.getResources
returns an empty enumerator.
ServiceLoader.load(``Service``)
which delegates to ServiceLoader.load(Service.class, Service.class.getClassLoader())
which eventually calls CeylonModuleClassLoader.getResources
@kiti-nomad what John told is correct, but in short, AOT stands for “Ahead of Time” compilation and JIT stands for “Just in time compilation”.
The main difference is when the compiler generates specific machine code instructions and performs optimisations.
With AOT, the compiler generates architecture specific binary before a single line of code is executed—i.e. Ahead of (execution) Time. The optimizations that a compiler can do at that time are extensive, but can not accout for runtime characteristics of the particular program.
With JIT, the compiler starts out by interpreting the code when first executed and as it gets more info on the runtime characteristics of the code, it starts replacing bits of the interpreted runtime with architecture specific machine instructions, applying optimizations as it is running the code. Effectively, creating optimized set of instructions Just in the time (of execution).
` public interface Condition {
Condition FALSE = facts -> false;
Boolean evaluate(Fact<?> fact);
default Condition and(Condition other) {
return fact -> this.evaluate(fact) && other.evaluate(fact);
}
default Condition or(Condition other) {
return fact -> this.evaluate(fact) || other.evaluate(fact);
}
default Condition not() {
return fact -> !this.evaluate(fact);
}
} @Test
public void testCondition() {
String str = "A String";
Condition a = fact -> !str.isBlank();
Condition b = fact -> str.contains("A");
a.and(b);
}`
interface Condition<Fact>{
shared static Condition<Fact> falseCondition => object satisfies Condition<Fact> {
shared actual Boolean evaluate(Fact fact) => false;
};
shared static Condition<Data >create<Data>(Boolean(Data) evala)=> object satisfies Condition<Data>{
shared actual Boolean evaluate(Data fact) => evala(fact);
};
shared formal Boolean evaluate(Fact fact);
shared default Condition<Fact> and(Condition<Fact> other)=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => this.evaluate(fact) && other.evaluate(fact);
};
shared default Condition<Fact> or(Condition<Fact> other)=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => this.evaluate(fact) || other.evaluate(fact);
};
shared default Condition<Fact> not=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => !this.evaluate(fact);
};
}
shared test void testConditions(){
value a=Condition.create<String>((String fact) => !fact.empty);
value b=Condition.create<String>((String fact)=> fact.contains("A"));
value result=a.and(b).evaluate("A string");
assert(result);
}
Condition.create
as top level function so You don't have to prefix it
and
and or
but function reference like in create so it would be: interface Condition<Fact>{
shared static Condition<Fact> falseCondition => object satisfies Condition<Fact> {
shared actual Boolean evaluate(Fact fact) => false;
};
shared static Condition<Data >create<Data>(Boolean(Data) evala)=> object satisfies Condition<Data>{
shared actual Boolean evaluate(Data fact) => evala(fact);
};
shared formal Boolean evaluate(Fact fact);
shared default Condition<Fact> and(Boolean(Fact) other)=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => this.evaluate(fact) && other(fact);
};
shared default Condition<Fact> or(Boolean(Fact) other)=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => this.evaluate(fact) || other(fact);
};
shared default Condition<Fact> not=> object satisfies Condition<Fact>{
shared actual Boolean evaluate(Fact fact) => !this.evaluate(fact);
};
}
shared test void testConditions(){
value a=Condition.create<String>((String fact) => !fact.empty);
value b=((String fact)=> fact.contains("A"));
value result=a.and(b).evaluate("A string");
assert(result);
}
Does ceylon-1.3.3 support static
interface member? I'm frequently getting following exception:
Ceylon backend error: method does not override or implement a method from a supertype
Some classes are missing from the generated module archives, probably because of an error in the Java backend compilation.
This is the case both from CLI and IDE-eclipse(oxygen) & IntelliJ-2017.2. JDK is 1.8.0_202 on Windows 7