Mariano Guerra
Orion Reed
08/04/2020, 11:12 AMMariano Guerra
Mariano Guerra
Mariano Guerra
Mariano Guerra
Duncan Cragg
08/04/2020, 11:23 AMMariano Guerra
Duncan Cragg
08/04/2020, 11:24 AMMariano Guerra
Duncan Cragg
08/04/2020, 11:27 AMChris Knott
08/04/2020, 12:14 PMPaul W Homer
08/04/2020, 1:08 PMAndrew F
08/04/2020, 5:47 PMAndrew F
08/04/2020, 7:38 PMshalabh
08/05/2020, 7:48 AMN/A
but that conflates null and "". Sometimes you might be asked to write why it is N/A
.
Consider that there are valid questions for which the meaningful answer is zero: "How many toilet paper rolls are there in the store?", "What is the temperature of the snow?" etc. There are no questions where the 'empty string' answer has a clear-cut meaning: "What is your spouse's name?", "What city do you live in?" etc. What does an answer of ""
mean? It could mean "I don't know" or "I dont want to tell you" or "There isn't one". Can these always be mapped to null or ""? I don't think so.
In type systems that have both, the empty string and null, you end up with the question of 'what does null mean' vs 'what does empty string mean'. Sometimes when you have two missing values in the world that you want to model - you end up mapping these to '' and null. But really this has nothing to do with a generic solution - it's often just a reality twisted to fit the types. If you want to model three missing values e.g. 'unknown', 'non-existent', 'secret/intentionally-blank' - how do you map these to "" and null? Maybe the best solution here is to model the value as an enum? unknown, non_existent, intentionally_blank, value(real_string_here)
. AFAIK no systems, languages have a great solution. However I feel better solutions lie in exploring the 'information modeling' space - RDF etc (perhaps with some kind of versioned schemas to describe what is possible and necessary.) Basically we don't want multiple data representations to correspond to a single reality (which is what happens in null vs "", or sometimes with nested option<option<option<t>>>
).Orion Reed
08/05/2020, 7:58 AMDuncan Cragg
08/05/2020, 8:19 AMOrion Reed
08/05/2020, 8:22 AMDuncan Cragg
08/05/2020, 8:22 AMDuncan Cragg
08/05/2020, 8:23 AMDuncan Cragg
08/05/2020, 8:28 AMDuncan Cragg
08/05/2020, 8:30 AMshalabh
08/05/2020, 8:36 AMif text is none: ...
. So the system does look inside this shape.shalabh
08/05/2020, 8:42 AMapple
vs [apple]
looks suspicious.Mariano Guerra
Mariano Guerra
Duncan Cragg
08/05/2020, 9:40 AMDuncan Cragg
08/05/2020, 9:41 AMDuncan Cragg
08/05/2020, 9:42 AMapple
isn't the same as [apple]
, or even why have those bracketsDuncan Cragg
08/05/2020, 9:43 AMfruit: apple
then fruit: apple pear
and no brackets, no "list type"Duncan Cragg
08/05/2020, 9:44 AMfruit:[1]
will always be apple
Dan Cook
08/06/2020, 7:56 AMundefined
?Duncan Cragg
08/06/2020, 10:58 PMDuncan Cragg
08/06/2020, 10:59 PMDuncan Cragg
08/06/2020, 11:00 PMGarth Goldwater
08/07/2020, 12:14 AMGarth Goldwater
08/07/2020, 12:14 AMGarth Goldwater
08/07/2020, 12:16 AMGarth Goldwater
08/07/2020, 12:17 AMshalabh
08/07/2020, 12:47 AMa[0] == a
is true for strings of length 1. You can also loop over them for char in a
will work for zero, one or longer length strings. Things don't come crashing down.shalabh
08/07/2020, 12:50 AMunknown
and an apple
?Dan Cook
08/07/2020, 3:07 AMDuncan Cragg
08/07/2020, 1:01 PMDuncan Cragg
08/07/2020, 1:01 PMfruit: *unknown* apple *unknown* banana
, yesDuncan Cragg
08/07/2020, 1:02 PMfruit: *nothing* apple *nothing* mango
collapses to just fruit: apple mango
Duncan Cragg
08/07/2020, 1:03 PMfruit: *nothing* banana
is just fruit: banana
(no list any more)Duncan Cragg
08/07/2020, 1:05 PMDan Cook
08/07/2020, 3:01 PMDuncan Cragg
08/07/2020, 3:22 PMDuncan Cragg
08/07/2020, 3:24 PM