Questions tagged [nothing]

In VB.NET, Nothing refers to something which has not been initialized. In C# it would be null. Occasionally used in the Scala type system.

140 questions
3
votes
2 answers

Is Nothing comparison gives type mismatch

I am trying to check if the 'Listivew.Tag property is nothing'. I used to do the 'Is Nothing' check universally for all scenarios as first check to avoid errors Can someone explain how to do it in VB 6? If Not .lvwLocation.Tag Is Nothing Then …
Sujit Prabhakaran
  • 295
  • 3
  • 12
  • 26
3
votes
6 answers

Check for Nothing in vbscript/classic asp

I need to update an old classic asp, and I have to call a function that normally returns an array, but under certain circumstances might return either Nothing or an undefined value. How can I check that the result actually returns an array?
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
3
votes
2 answers

Difference between and <*> in generics in kotlin

I don't understand the difference between and <*> in generics. I know that using <*> is like doing and at the same time, but using cause the same result.
3
votes
3 answers

Why does map/filter ... not work with an Array of Nothing?

Isn't Nothing a subtype of all types? scala> val array = new Array(5) array: Array[Nothing] = Array(null, null, null, null, null) scala> array.map(_ => 42) :9: error: value map is not a member of Array[Nothing] array.map(_ => 42) …
soc
  • 27,983
  • 20
  • 111
  • 215
3
votes
3 answers

'getView' overrides nothing

I am new about android studio. I tried to use ArrayAdapter. But when i complete my codes, it says "'getView' overrides nothing".I getting this error in "return teksatirview code. this is my arrayadapter class: package com.example.burcrehberi import…
akiilhan
  • 169
  • 4
  • 13
3
votes
2 answers

HasValue giving value 0 instead of Nothing

Question is simple, when I pass CustomClass which is Nothing into Run method at the end in Query method second.HasValue is showing 0. Shouldn't be Nothing? Public Function Run() As Boolean Return Query(if(CustomClass IsNot Nothing,…
Arie
  • 3,041
  • 7
  • 32
  • 63
3
votes
1 answer

Unit vs Nothing in Scala

I'd like to clarify some details about Unit and Nothing. For example: def unit(companyId: Int): Unit = {} def Nothing(companyId: Int): scala.Nothing = {} According to the docs, Unit in Scala is very similar to void in Java. But test("test Unit…
user5607337
3
votes
1 answer

A class contains an array of objects. Do I need to set each of them to nothing on terminating the containing class?

I am working with code something like the below. An array of BasketItemViewModel is created in the scope of the Basket class by looping DB results and creating a view model from each row. When I ditch the Basket class, and Set it to nothing, am I…
Martin Hansen Lennox
  • 2,837
  • 2
  • 23
  • 64
3
votes
1 answer

Suffering from Nothing

How does the A turn to be Nothing in the process? def seq2map[A](src: Seq[A]): Map[A, A] = { def pair = for { f <- src.headOption s <- src.headOption } yield (f, s) Stream continually pair takeWhile(_ isDefined)…
Ryoichiro Oka
  • 1,949
  • 2
  • 13
  • 20
3
votes
6 answers

Convert String.Empty to Nothing/Null

Is there a .Net function that does that. I guess if there isn't i have to make my own method. The thing is i have a function. It accepts integers. If you pass a 0 integer or a null value it still works. Problem is that the value of an empty textbox…
Tomasi
  • 2,517
  • 6
  • 31
  • 43
3
votes
1 answer

Why doesn't Scala's implicit class work when one of the type parameters should be Nothing?

Update: I modified the example so that can be compiled and tested. I have an implicit class that defines an enrichment method: case class Pipe[-I,+O,+R](f: I => (O, R)); object Pipe { // The problematic implicit class: implicit class…
Petr
  • 62,528
  • 13
  • 153
  • 317
3
votes
2 answers

Why to set an object to Nothing in the Finally block?

In this VB.NET code: Dim o as SomeClass Try o = new SomeClass 'call some method on o here Catch(...) ... Finally o = Nothing End Try Why is there a need to set o to Nothing? What if i don't set it to Nothing in the Finally block? What i…
badmaash
  • 4,775
  • 7
  • 46
  • 61
2
votes
2 answers

Scala: using Nothing for singleton instances of polymorphic types

Given a polymorphic trait like trait Transform[T] { def apply( t: T ) : T } one might like to implement various specialized instances, such as case class Add[Double] extends Transform[Double] { def apply( t: Double ) ... } case class…
Gregor Scheidt
  • 3,952
  • 4
  • 24
  • 28
2
votes
2 answers

How to create a function return nothing in Julia?

When I create a function in Julia, I print something in the function and don't return anything. But the result is the function print what I want and also return 'nothing'. What can I do to make the function just print what I want without return…
CHIA YI
  • 107
  • 4
2
votes
0 answers

Using generic with Kotlin and MVP Android

I'm new to Kotlin and I started a new Android project using this language. From the beginning I faced some issues when a tried to make a schema of a MVP pattern in Kotlin using generic types. This is what I'm trying to…
mrRobot
  • 21
  • 3
1 2
3
9 10