Functions

Open Stories and Issues

_class should cope with multi-paragraph text: Currently, the _class function can only deal with one paragraph. It would be preferable if it could deal with multi-paragraph input in some sensible way.
_isEmpty should give a warning when used with ExactlyOne: That is, _isEmpty can never be true with ExactlyOne, by definition, so using it there indicates an error.
_isEmpty should respect "emptiness" of the PType: Currently, if I have Property P of Exactly One Large Text, P -> _isEmpty will always return false -- by definition, Exactly One can't be empty. But that's unintuitive: if the text length is zero, I expect it to return true.
_isNonEmpty doesn't produce expected results with Text: Intuitively, users are going to expect _isEmpty and _isNonEmpty to do appropriate things with Text Properties -- that is, test the string length.
_QLButton (etc) should be able to deal with numbered function parameters: Currently, we pass the context and the bound names that are used, but not $_1, $_2, etc. In principle, this is a bug in _QLButton.
_QLButton should be able to accept more arbitrary types: Currently, you can only pass Thing references into _QLButton, either as context or bound names. In principle, this should be generalized.
_tagRefs doesn't know that space and dash are equivalent: Noticed in the Period Games Space. If, say, an External Link points to "Byzantine-Chess", the Byzantine Chess page's _tagRefs doesn't catch it. This is presumably because _tagRefs doesn't know to normalize spaces in link names.
_thingValues should take a Person, not an Identity: Currently, _thingValues takes an Identity. That made sense once upon a time, but has long since been left behind by events -- it just causes hassles with no benefit. It should take Person instead.
Add an _nth() function: We have _first, of course, but there are times when it would be nice to have a more general counterpart.
Deprecate and remove _editAsPickList: Now that we have _checkList(), this can go away.
Follow-on mutable functions don't seem to work: Not sure of the details here, but noting it for investigation.
Function parameters don't propagate across _QLButton() boundaries: See this Backbone issue for the details. I worked around it there, but we need to fix the underlying problem.
I can replace *any* Property Value with a QL Expression: Huge, powerful and terrifying, but clearly correct. This would be the Querki equivalent of the common notion that, at the interface layer, a property can be either a value or a function.
I should be able to confirm a QLButton: That is, I should be able to specify a message that will be displayed when I press the button; if I press the button again, it will take effect.
I should be able to define bullet lists with other indicators: CSS allows all sorts of things in the list-style-type -- we should make it easy to use those, probably with an optional parameter to _bulleted.
I should be able to define delete buttons on-page: This is specifically for _checkList, but should be more generally useful.
I should be able to define non-immediate input fields on-page, and access them from a _QLButton: This needs more design, but the point is letting us implement the search plus checkboxes that Anna has spec'ed for the Arisia Space.
I should be able to define Signatures for my own Functions: We've added the concept of Signatures and Named Parameters, and those are beginning to work nicely for InternalMethods. But there is no way to do that for user-defined Functions yet.
I should be able to determine the membership status of the current user: There are some hacks around this, but I don't think they are reliable.
I should be able to easily create a tweaked copy of a Thing: This would be similar to the Scala case class copy function, creating a copy, possibly with tweaked fields.
I should be able to export JSON: The exact way we specify the format this isn't obvious. Function? Object? Both?
I should be able to Link to Instances Only: This is a cognate to "Link to Models Only".
I should be able to preserve closures across a _QLButton: Specifically, bindings from outside should work inside the button.
I should be able to specify that a _linkButton is disabled: Eric would like to be able to show navigation buttons that are always there, but disabled for the current page. It's a reasonable desire.
I should be able to specify the priority of different Properties in _search: The high concept is that not every Property always matters equally when searching. We already automatically give extra weight to Name; we could expose that as a more general capability for end users.
I should be able to strip duplicates from a List: Not sure what the best approach is -- might be an explicit function to so this, might be a _toSet function.
I should be able to use bound names as Function parameters: Ran into problems using them for a user-defined Function.
I should have an easy way to "cut" long lists: This is a request from Eric, which needs some thought.
I shouldn't need to specify _self on the properties in _search: It's just plain annoying, and the source of mysterious bugs.
If you feed an empty list to _checkList, it throws an exception: Discovered this while setting up the shopping list -- gave errors until I defined the first Item.
Make Issues by Submitter prettier: Issues by Submitter is currently ugly. It should have a separate section for each Submitter.
Need a better approach to pagination: The Comics Space is illustrating that the showSome mechanism just isn't good enough for general pagination. In particular, the page needs to be in the URL, so that I can reload to that point.
Need clearer error message when you try to dereference Properties on a primitive Type: I've been working on formatting the Stray Bullets Timeline page, relying heavily on _groupBy. However, some QL code I came up with (in Event) for displaying Time with a colon in the middle strangely doesn't work when nested inside _groupElements. At least, that's what I suspect the culprit is.
Suggestion: English-Major sorting: Sorting is currently a standard, completely literal sort. Many users of Querki are going to want sorting to behave in a more nuanced manner.
The _createHere function is fundamentally impure: The function works fine, mind, but it's potentially a bad camel's nose in the tent. Can we come up with a pure way to accomplish the same goal?
The _QL functions shouldn't require a Thing as their context: Specifically, Eric is trying to put _QLInput into the Page Header of an unrefied Tag, and it's crapping out because the _QLInput isn't receiving a Thing.
The names of _bulleted and _commas are inconsistent: Eric reports that, based on _commas, he expected _bullets to work. That seems reasonable -- we should probably make this more consistent.
You can't define a _sort expression with types other than Link: That is, you can't say _sort(EXP) if the received Type isn't Link. _sort just doesn't cope with that yet.

Closed Stories and Issues

_changeProperties() should produce all of the Things it receives: Currently, it explicitly only returns _.head from the results -- it should return all of them.
_checkList should be hidden until we are ready to use it: It's not ready for prime time, so it shouldn't be in the Functions list.
_class and _data foul up HTML entities: For example, if you give the expression ""I'm an expression"" -> _class(""something""), it comes out as "Im an expression"
_concat fails if the second parameter is empty: Specifically, it produces an error "The parameters of _concat() must all be the same type; this contains both Thing Type and Unknown Type".
_concat often results in cryptic errors if the Types don't line up: For example, if I try to concat a list of Tags with one of Links, it produces an internal error eventually.
_createButton doesn't work with a Tag Set Link Property: Specifically, in the Period Games Space, Game should be able to say External Link -> Games._createButton() and have it get populated. But it doesn't -- presumably because it only works with single-valued Links currently.
_createHere isn't setting the defining Property?: Needs investigation. What I'm sure about is that the Add Issues function in the Comics Space is failing to set the link from the Issue back to the Title. Why?
_data produces an odd error if it receives an empty List: It's a transformation -- it should just allow empty lists through silently.
_filter() can't cope with a weakly-defined parameter: This shows up in the Cross Stitch Space -- the Completed Projects page is showing an error.
_greaterThan, _lessThan don't deal properly with Lists: They work fine when receiving single values, but always return false when they receive a List.
_groupBy should work on the results of _search: This appears not to work, apparently because _groupBy only accepts Things. It should accept PropertyBundles.
_instances should return the list pre-sorted: You want the results sorted at least 90% of the time, so we should just do that and be done with it.
_isEmpty producing unexpected results with Whole Number: Closely related to https://www.querki.net/u/jducoeur/alpha-issue-tracking/#!isNonEmpty-doesnt-produce-expected-results-with-Text
Space Stray Bullets, Thing Reference: Properties End Page and End Panel are both Optional Whole Numbers. When those properties have never been filled in, and contain no data, they do not register as _isEmpty.
_linkButton should open a new window when appropriate: We've settled on a standard that absolute URLs open in a new window. _linkButton should follow that.
_navigateTo does nothing if we are navigating to the same page: Intuitively, I expect that _navigateTo in this case should cause a reload, and there are times where we depend on this.
_notify() requires better security: As currently constructed, anybody who can write QL can send notifications, which is deeply Not Okay.
_notify() to large numbers of recipients hard-crashes Querki: This is a P0 bug, since it actually crashed the whole cluster. Worse, it destabilizes the cluster, making recovery tricky.
_oid should work for OIDs that *don't* correspond to real Things: Probably never useful for user-level code, but I need this for the App Gallery
_QLButton doesn't work right if you pass in a List: If you do something like: <One Thing, Another Thing> -> _QLButton(label=""Passed directly"", ql=""____""), you expect this to display one button that shows two links when pressed. In fact, it displays two buttons.
_QLInput is failing, complaining about the noicon parameter: This is a problem in how tightly factored-together the _QL functions are -- it's trying to look up "noIcon", which isn't defined for _QLInput.
_refs doesn't pick up references from Model Properties: If I have a Link Set defined in a Model Property, and then set Links in a Thing that uses that Property, _refs doesn't pick it up.
_refs should include _tagRefs as well: This is long since overdue -- the _refs / _tagRefs distinction is a fiddly detail that doesn't make any sense from an end-user POV.
_self throws an Unexpected Error is used in a non-dotted position: Nothing complex here: it just has a hard assumption built in, and isn't defensive enough.
_showLink always opens a new window; there is no way to prevent it: This is frustrating when you're using it with, eg, _createInstanceLink, and specifically don't want that to open a new window.
_showLink is over-escaping its contents: I have a Property containing [[Visible Game Items -> Qualify Game Items By Type]] - [[_showLink(Update Summary)]]. When Update Summary has characters that need to be HTML-escaped in it, they display as the full HTML-escaped string, which makes it really hard to skim. If I eliminate the _showLink call, Update Summary displays correctly.
_sort appears to be case sensitive?: See New MySQL Space, specifically all the pages named "Testing ...". It looks like they're collating case-sensitively, which is wrong: Querki is officially case-insensitive.
_sort should be able to take parameters for non-bundle types: If you say _sort(func -> func -> func), that all works as expected for Things and other sorts of PropertyBundles. But the parameters are ignored for other data types.
_sort() doesn't work with coerced Types: That is, if I have a List of mixed Types, where they Types can be coerced to match, they don't sort together properly.
_tagRefs can't find tags on Properties or Types: Nothing fancy -- it's just not looking at them.
_textLength producing weird results : Stray Bullets Space, model Event: I wanted to have the Notes field only display when it actually had contents, whixh it often won't. Since I was trying to at least temporarily avoid _isEmpty with text, I tried using _textLength instead, figuring that would be 0 when I hadn't entered anything. That didn't work, so to figure out why not, I just printed the result of _textLength(Notes)) in the default view. Much to my surprise, the numbers given are not only not 0, they range between (at least) 8 to 53! Each Event seems to have a consistent value being returned, but damned if I know where it's getting that number.
_thingConversations does not render the QL in the comments: When you look at the comments via _thingConversations, you see the raw QText, unexpanded.
_withValueIn() results eventually show QL.timeout error: The problem is pretty clear: we are caching an InvocationValue, which makes sense in principle, but in practice that InvocationValue includes its start time, which eventually causes a timeout.
._self causes QL to crash: Eric originally reported this as a more complex QL expression, but the essence of the bug is that, if you say ._self in a QL expression (with nothing before the dot), the parser crashes.
_changeProperties can't set an Optional value to empty: For example, if you have a Property named Optional Number, and try to set that as _changeProperties(Optional Number(< >)), you get the error Optional Number parameter 0 should be of type Whole Number Type but is actually Unknown Type.
_changeProperties doesn't work correctly if you pass multiple Things in: For automation, Eric wants to be able to apply the same change to multiple (perhaps many) Things at once using _changeProperties, but only one takes effect.
All Things is showing Simple Page: If you look at the All Things page, it includes the long-dead Simple Page model.
Ampersand in unreified tag is causing problems when indirected through a function: This is currently repro'ed in New MySQL Space with the "Branch & Claw" Tag, which fails to display its Page Header, while "Core Game" succeeds.
An empty element in a List Literal causes it to fail: The simple reproducer is <_if(false, 1), 2, 3> -- I expect that to display 2 3, but it actually shows Expecting type Unknown Type, but actually got type Whole Number Type.
Arithmetic functions should work with mixed Types: Currently, the _plus, _minus, _times and _divideBy functions only work if the parameters are the same Type. They really should work with any combination of numeric Types.
Can't test for an empty _groupKey: The issue is basically that [[_groupKey -> _isEmpty]] always comes out false, even if the actual key was empty.
Can't view the manual page for _search: Not clear what's going on, but there's an error in the Client.
Computed Name is seriously broken: See, for example, the listing for The Quest in the Period Games Space. The link to the reconstruction is hosed.
filterField for _checkList chokes on upper-case: When filtering a checklist, type in a capitalized word -- it won't match anything.
Filtering seems to be subtly broken: See the list under Critical in this Space for the model -- it's showing lots of Issues that it shouldn't be.
Functions appear to be multiplying their results: Discovered in Kate's Cross Stitch Space, and reproduced in New MySQL Space as Function Testing Thing.
I can have a new Thing point back to the creating Thing: I've found that I often wind up with parent-child relationships between Things; in particular, I often want to put a button on Parent that says, "Create a new Child". All of which works decently well (using _createButton or _createInstanceLink), but with one problem: the Child doesn't start out with the pointer back to the Parent. I have to set that back-link manually, which is a hassle.
I can take the first N values from a List: That is to say, implement the usual "take" function. Probably do "drop" while we're at it.
I should be able to ask whether a given Thing is descended from a given Model: Requested by Eric, this is essentially the _isa function.
I should be able to check containment of Sets in Sets: It's common to want to ask, "Are any of the following values found in here?" or "Are all of the following values found in here?". Currently, this is doable, but kind of a pain.
I should be able to check whether a received value is contained in a Collection: This is basically the inverse of _contains(). It isn't strictly necessary, but makes some expressions cleaner.
I should be able to compose a serious mailto: link in Querki: I believe I'm going to want this soon for the Arisia Press Space.
I should be able to concatenate unrelated Lists: Sometimes I have multiple Lists from very different sources, but they are the same Type, and I would like to display them together.
I should be able to define ad-hoc Property Bundles in my QL pipelines: This is needed to make the _JSONify function sufficiently flexible for the Arisia Use Case.
I should be able to define how my _checkList items render: Currently, we just display the display name. We should be able to render each item in arbitrarily-complex ways.
I should be able to delete a Thing from QL: Specifically, this means adding a _deleteThing() function, to match _createThing().
I should be able to do an "inline search" from QL: That is, there should be a _search() function that happens synchronously inside a QL expression, and lets you process the results yourself.
I should be able to easily find the minimum / maximum values in a list: Eric pointed out a specific use case, but let's just do this right.
I should be able to enter input to pass to QL: The theory here is to add a _QLInput() function, which displays an input box and then passes that input to the given QL expression.
I should be able to filter _tagRefs by Property: This is the motivating story for unifying _refs and _tagRefs. Currently, _tagRefs shows all Things that refer to this Tag, and there is no good way to filter that by Property.
I should be able to fold over Lists: Specifically, I need to be able to sum a List. But let's implement the more powerful general case first.
I should be able to get at the creator of a Thing: Requested by Eric, and now easy to implement.
I should be able to get the length of a Text field: Eric is trying to test the length of a string -- specifically, if a search fails to return anything, to check whether it's shorter than the minimum 3 chars. Adding a function for this seems straightforward.
I should be able to get the time when something was created: This is a new _createTime function, to complement _modTime.
I should be able to make a QLButton that always adds: See the "Add Issues" button in the Comics Space. This doesn't want to be an open/close like most QLButtons -- it wants to always add sections, and wants to always append to the named div.
I should be able to see the system functions, categorized sensibly: The list of functions has gotten too large to easily internalize. They need to be grouped in order to be usable.
I should be able to sort on multiple Properties: The _sort Function should accept multiple parameters, and sort on them all in major/minor order.
I should be able to subtract a value: Basically, we need a _minus function, similar to _plus.
I should be able to subtract a value: Fakery with _plus can only go so far -- we need a _minus as well.
I should be able to test whether a given name is bound in-scope: Eric points out that he needs this in order to test whether a page's query parameter is properly set up, and show a good error if not.
I should be able to turn a Querki value into JSON: Needed for the Arisia Use Case.
I should be able to use _refs without a specific Property: This has worked for _tagRefs forever; _refs should also cope.
I should be able to use _class, _data and _tooltip more widely: These functions only work on HTML, which makes sense. But you often want to use them on other sorts of Things, specifying attributes they will have post-rendering. That is remarkably hard to express at this point.
I should be able to view Recent Changes in this Space: This is the underlying Epic behind a lot of Eric's recent requests. It is the holding pen for designing the sucker; bits will get broken out into their own stories.
I should be able to write a QL expression that forces navigation: The theory here is to add a _navigateTo() function which, when evaluated, turns into some sort of Wikitext that tells the Client to do an immediate navigation.
I should have a side-effecting way to debug complex functions: Right now, it is way too hard to figure out when something has gone weirdly wrong. We need a way to deal with this.
If I try to display a completely-empty Location, I get an Unexpected Error: This turns out to be a bug in the code for processing List Literals.
If the Computed Name of my Thing is empty, I wind up with unclickable empty links: That's my hypothesis about the behavior Eric is reporting, anyway.
Indirection through a Model, _if and _is: This one is just plain strange -- see the Details
Need a "clear" button for _textInput: The _textInput turns out to be a nuisance to use on the phone. We need a "clear" button -- an "X" or something -- so there is an easy one-click way to erase it.
Numbered parameters and bound names don't work in _QLButton / _QLLink: Basically, if you specify then in the ql parameter, they just plain don't work.
QLButton always adds a div, even when you don't want it: This is sometimes a big problem -- for example, I want to be able to output a table row, which cannot be in a div.
sort(desc(modTime)) seems to be broken: Not sure what's going on, but Issues by Modification Time in this Space appears broken.
Sorting on field of Model Types is apparently messed up: See this page for an illustration of the problem -- he has a List of Model Type, which he's trying to sort on the fields of that Model, and it's not working as expected.
Sorting on text results not case-insensitive: Discovered this while dealing with Sorting on field of Model Types is apparently messed up -- turns out that ParsedTextType is sorting case-sensitively. To be consistent, this needs to be fixed.
There is no longer a way to use _if on an entire List: For example, you can't say _if(_isEmpty, ...), which is terrible.
There should be a more-efficient way to look up which Things have particular values in their Properties: See the documentation of _withValueIn -- this story is a retrofit for that new function, which I decided I need for Backbone.
There should be a straightforward way to update a section of the page when I press a QLButton: It is currently pretty easy to reload the entire page, but just updating part of it is way too hard.
When _if receives an empty List, it doesn't do *anything*: Gah -- and here I thought I finally had _if working entirely correctly.
XmlHelpers.toNodes() is too damned fragile: Eric hit a problem where an embedded conversation node choked, probably because of something that didn't get escaped properly.