Questions tagged [reification]

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

67 questions
9
votes
3 answers

Any word on reified generics in Java?

I know this question will probably provoke more discussion than concrete answers (which I know isn't preferable). But with the recent acquisition by Oracle, I was wondering if there's been any word that Java might (someday) get reified generics? …
nonoitall
  • 1,232
  • 1
  • 15
  • 25
7
votes
2 answers

Overloading generic event handlers in Scala

If I define the following generic event handler trait Handles[E <: Event] { def handle(event: E) } with event type's like this trait Event { } class InventoryItemDeactivated(val id: UUID) extends Event; class InventoryItemCreated(val id: UUID,…
Lars Tackmann
  • 20,275
  • 13
  • 66
  • 83
7
votes
2 answers

What are the limitations of Scala's Manifests?

Scala's Manifests are a way to get around some type erasure problems due to the JVM's lack of reified generics. They are discussed in several other questions; here are a few: What is a Manifest in Scala and when do you need it? How does Scala's…
Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234
7
votes
2 answers

How can I store reified type data in instance fields in Kotlin?

I'm currently writing a DSL for a library and I'd like to supply type metadata using reified type parameters like this: val config = Config.create() .consumerFor{ // consume } My problem is that i…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207
6
votes
2 answers

Explanation for reification in RDF

I am have understand the basics of reification in RDF. Two clearly explanations are given here: explanation 1 and explanation 2. If you observe carefully, actually we can present in the sentence "Earth is round" RDF triple where as "Scientist…
Nusrat
  • 699
  • 1
  • 5
  • 16
5
votes
2 answers

Filter for generic type without reflection or casting

In Kotlin there is a limited form of reified generics. Is there any way to use reification to filter for a generic type without using getClass() or as or any kind of weird annotation, ie. just by using the is keyword? For example, I have the…
breandan
  • 1,965
  • 26
  • 45
5
votes
0 answers

How to dynamically rewrite CLP(FD) constraints to help reification

My question is linked to this (now 1-year-old) post regarding reification issues in a CLP(FD) program : link The prolog file I give to the SWI engine is programmatically written on-the-fly, based on some data that users can add/edit/remove with…
M.V.
  • 177
  • 9
5
votes
2 answers

Casting to a Class which is determined at run-time

I have a method fetchObjects(String) that is expected to return an array of Contract business objects. The className parameter tells me what kind of business objects I should return (of course this doesn't make sense in this construed case because I…
Yang Meyer
  • 5,409
  • 5
  • 39
  • 51
5
votes
3 answers

SWI Prolog Clpfd Library - Reification

I have an upcoming Logic exam and have been studying some past papers from my course. I've come across a question regarding reification and have posted it below; Illustrate reification by using it to express the property that a variable B…
user6066919
5
votes
1 answer

How to check I'm inside a @specialized function or class at runtime in scala?

Let's say I have a specialized class and an associated companion object: trait Slice[@specialized +T] { ... override def equals(that :Any) = that match { case s :Slice[_] => ??? case _ => false } } object Slice { …
Turin
  • 2,208
  • 15
  • 23
5
votes
1 answer

The relationship between quotation, reification and reflection

I recently get confused with quotation, reification and reflection. Someone could offer a good explanation about their relationship and differences (if any)?
day
  • 2,292
  • 1
  • 20
  • 23
4
votes
4 answers

Capture method missing in Javascript and do some logic?

In Ruby, you can capture a call to a method which is missing and define it on the fly. What I wanna accomplish in JavaScript is to have an object with no methods. I want a missing method to be translated into a call to emit(): app.isReady() ->…
ajsie
  • 77,632
  • 106
  • 276
  • 381
4
votes
1 answer

Do we need metaclasses to do this, or is reflection enough?

So I have been quite looking forward to metaclasses. I then heard that it won't be in c++23, as they think we first need reflection and reification in the language before we should add metaclasses. Looking over c++23 reflection, there appears to be…
Yakk - Adam Nevraumont
  • 262,606
  • 27
  • 330
  • 524
4
votes
1 answer

Check reified generic type at compile time

I have a function which checks its generic type parameter, and if the type is one of the expected values, does something with it appropriate for that type. If the type is unexpected, it throws an exception. inline fun
Graham Borland
  • 60,055
  • 21
  • 138
  • 179
4
votes
2 answers

Simple Format for Implicit Reification

Is there any RDF serialization format (like Notation 3) that supports implicit reification for easily representing statements about statements? For example, say I have the statement "Mary bought a house", which I would represent in N3 like: :Mary…
Cerin
  • 60,957
  • 96
  • 316
  • 522