Questions tagged [reification]

Reification refers to process of taking an abstract concept and making a concrete representation out of it.

67 questions
1
vote
1 answer

How to add comments in quasiquote

I am trying to insert class comments for quasi quotes like so q""" package somePackage { /** * This is a comment */ public class SomeClass { } } """ But its throwing an exception Exception in…
user1187135
1
vote
1 answer

How to implement that generic function with TypeTag in Scala?

Suppose I need to write a function convert[T]: String => Option[T], which works as follows: import scala.util.Try def toInt(s: String): Option[Int] = Try(s.toInt).toOption def toDouble(s: String): Option[Double] = Try(s.toDouble).toOption def…
Michael
  • 41,026
  • 70
  • 193
  • 341
1
vote
1 answer

Generic Types incompatible with given method signature?

Given the following method: public void bindContentBidirectional(final String fieldPath, final String itemFieldPath, final Class itemFieldPathType, final ObservableList list, final Class listValueType, final…
brcolow
  • 1,042
  • 2
  • 11
  • 33
1
vote
1 answer

Neo4j: How to model relationship properties that are nodes?

Suppose I have a simple relationship like CREATE (a:Company { name:"Apple" })-[:BUYS]->(b:Company { name:"Beats" }) Now I want to collect metadata on the :BUYS relationship - which User created that Relationship and what are the sources that…
chiborg
  • 26,978
  • 14
  • 97
  • 115
1
vote
2 answers

Making statements about statements which are no reified

Forgive me if I'm misusing some terms, I'm just becoming familiar with RDF and reification in particular. What I'm trying to understand is if/how you can make a statement about a statement that you don't control and which isn't actually set up as an…
brianmearns
  • 9,581
  • 10
  • 52
  • 79
1
vote
1 answer

Why does Scala reify not work as according to the docs?

The Scala API docs for 2.10.3 say that I can, "Use refiy to produce the abstract syntax tree representing a given Scala expression." Accordingly, I can do: scala> val uni = scala.reflect.runtime.universe uni: scala.reflect.api.JavaUniverse =…
Andrew McKinlay
  • 431
  • 3
  • 15
1
vote
0 answers

Does reification of scala expressions work in v2.9?

I was playing around with scala lifting and I accidentally discovered that Scala seems has some sort of implicit support for lambda expressions. import scala.reflect.Code import scala.reflect.Function import scala.reflect.Select object Test { …
Maxm007
  • 1,190
  • 2
  • 13
  • 21
1
vote
2 answers

StackOverflowError during macro expansion of reify

I have a simple test macro that uses reify. It causes a StackOverflowError during macro expansion. def test() = macro testimpl def testimpl(c:Context)():c.Expr[Any] = { import c.universe._ val o = reify { // StackOverflowError here object…
Kim Stebel
  • 41,826
  • 12
  • 125
  • 142
0
votes
0 answers

Reification for interpretation functions which use different interpretation functions below quantifiers/lambdas

I'm currently trying use Isabelle/HOL's reification tactic. I'm unable to use different interpretation functions below quantifiers/lambdas. The below MWE illustrates this. The important part is the definition of the form function, where the ter call…
0
votes
2 answers

A Kotlin Serializer for Generic Custom Lists

In many Kotlin projects, I am using the NonEmptyList from arrow-kt for improved type safety. A problem arises when I want to serialize and deserialize such lists. My attempt at a generic custom serializer with delegation does not seem to work: class…
Ulrich Schuster
  • 1,670
  • 15
  • 24
0
votes
0 answers

What are the semantics of RDF reifications?

I am using Apache Jena, and I need to use RDF reification to express hypothetical statements about facts. For example, consider this: Alex "assumes" Eva was born between 1980 and 1990. Suppose we express the fact that Eva's birth occurred between…
Adel
  • 3,542
  • 8
  • 30
  • 31
0
votes
1 answer

How to create a factory with type-safe inputs using generics

I'm looking for a way to pass configuration input to a factory which is derived from a base class and holding different input parameters depending on that derived class for that factory. I'm struggling to find a good way to implement this. So let me…
ceedee
  • 371
  • 1
  • 11
0
votes
1 answer

How Kotlin type reification works on kotlin-js?

On JVM reified types provide a work around for the type erasure. Why does reification work in the same manner on kotlin-js? (i.e only with inline functions). Why not all types reify-able?
0
votes
1 answer

Reflection: Applying type parameters of declaring class to fields

I have the below class structure: class A { B b; ...... } class B { R t; } class StringConsumer { A a; } class LongConsumer { A a; } Given that I have an instance of one of the consumer classes,…
Erric
  • 750
  • 9
  • 29
0
votes
1 answer

Inferred types recognisable by protocol implementation in Kotlin

I'm trying to create a system where implementations of a protocol (or abstract class) fulfill the minimum requirements of that protocol, but still has access to the unique functionality that come with the provided solution. Let me illustrate with an…
Justin Hammenga
  • 1,091
  • 1
  • 8
  • 14