libera/#commonlisp - IRC Chatlog
Search
9:37:13
loke[m]
I did not know it was broken. When I used it, it worked fine. But I may have used it backwards. :-)
9:44:10
jackdaniel
well, I'm not sure whether it is broken, so I've asked for clarification! https://irclog.tymoon.eu/libera/%23clim?around=1679253495#1679253495
9:44:26
jackdaniel
I've started using the computer now, so I'll see to the commit you've asked about. perhaps we should move to #clim
9:56:07
jackdaniel
yes, and note that the second argument is NIL, so it is computing the line that goes from left to right
9:58:28
loke[m]
I'm testing with this: `(mcclim-bidi:directions "This is a test. في هذا اليوم. Another string." nil)`
12:33:36
loke[m]
jackdaniel: You're definitely right. You can just `NREVERSE` the list `RESULT` at the end of `DIRECTIONS`
12:35:44
loke[m]
There are a set of functions which accept and returns lists of symbols, where the list is always the same size as the string. We can gain a lot of speed by changing it to an array and modifying it in place.
13:22:02
jackdaniel
because there are a few moving parts: there is a page direction, a line direction and finally the text direction that may vary within the line
13:22:38
jackdaniel
page and line direction are the compositor things while the individual fragment of text direction should be handled by the renderer
15:04:49
jcowan
It shows images of Arabic text in a Mongolian matrix where the Arabic text has been rotated either counter-clockwise (read down, like the Mongolian) or clockwise (read up).
15:10:52
jcowan
There is also a neat example of English text reading upwards at the left edge of a table, but with embedded Chinese that is read downwards (in the normal direction for Chinese), thus requiring the bidi algorithm even though both English and Chinese are LTR when horizontal.
15:25:13
gendl__
(this format statement is from cl-pdf by the way, I'm setting up regression pipeline testing which includes some PDF output and trying to get the same input to yield identical output on all three of these impls)
15:26:18
gendl__
it seems CCL is prepending an extra space of padding - it feels like internally it's treating the -0.0 as 0.0 and not counting the `-` as a character.
15:27:56
gendl__
As far as I understand, the Allegro CL output is compliant - implementations are allowed for format `-0.0` as `0.0` -- Allegro does this, and prepends 5 spaces as does CCL, but in the case of Allegro the 5 spaces prepended appears correct because the `-` is not there.
15:28:54
semz
~8f is explicitly supposed to always output 8 characters, so CCL is definitely wrong here
15:31:34
gendl__
Are there any printer parameters or format directives to make it always include, or always suppress, the `-` ?
15:31:42
semz
(well, always*, since it can output more if it's impossible to fit the value in there. but this isn't the case here)
15:35:51
gendl__
In order to get my regression tests working with currently existing CCL (and with Allegro CL and SBCL, which both appear compliant but are giving different outputs) I think I will have to pre-process my test data to replace the `" -0.0"` or `" -0.0"` or `" 0.0"` with a normalized string e.g. `" 0.0"` (i.e. normalize on the Allegro version). So I'll need a regular expression which matches those three strings
15:35:51
gendl__
but is unlikely to match other strings in my output. ChatGPT suggests `^\s*[-0\.]+0$`
15:36:47
gendl__
i'll test that, but at first glance it looks like it will miss `" 0.0"` (maybe that doesnt' matter because i'm normalizing to that anyway)
15:48:32
gendl__
semz: thanks, ah, I see it will print either `-` or `+`. Good to know. In this case, the format code in question is in the cl-pdf library, so I don't have direct control over that nor would I ask the cl-pdf maintainers to change anything just for this reason. But the regexp provided by chatGPT does match all 3 variants, so i'll just run the seed data and my test output through a replace-regexp, before comparing.
15:50:08
gendl__
and the issue appears to be captured already in this CCL issue: https://github.com/Clozure/ccl/issues/406. CK-DE provided a long test case for formatting floats with ~f. SBCL and Lispworks appear compliant. I'll comment on that issue with Allegro output for the given test suite.
15:53:48
jackdaniel
regarding clockwise/counter-clockwise render I'm aware of that, that basically comes with the fact that vertical page may go left-to-right (lines), or right-to-left
15:54:37
jcowan
Mongolian however always goes left to right, and still Arabic can be embedded in it either way.
15:57:04
jcowan
My answer to https://www.quora.com/Why-are-some-language-scripts-like-Mongolian-written-vertically-instead-of-horizontally may provide some historical insight into the issue
17:10:06
beach
The dictionary entry for the declaration OPTIMIZE says that the consequences are unspecified if a quality appears more than once with different values. But what if such a quality appears once in each of two different consecutive declarations in the same form?
17:11:29
beach
Also, a (nother) WSCL issue: The dictionary entry for the declaration DECLARATION uses the term "declaration name", but I think it should be "declaration identifier". No?
17:13:57
beach
The dictionary entry for the declaration TYPE also uses "name of a declaration" and "declaration name".
17:36:25
jcowan
beach: I don't think consecutiveness matters, so presumably the later declaration wins; the effective scope of the earlier declaration just happens to be empty.
17:38:20
jcowan
So you are saying the scope of a global declaration is the whole program, or the current file, or what?
17:41:31
jcowan
Proclamations are defined as global declarations, so by "declarations" here you mean local declarations?
17:42:53
jcowan
Unfortunately 3.3.4 is silent as to the scope of declarations that aren't bindings, unless I am misreading it.
17:49:45
skin
http://www.lispworks.com/documentation/lw50/LWUG/html/lwuser-90.htm#:~:text=There%20are%20two%20distinct%20uses%20of%20declare%2C%20one,code%20faster%2C%20or%20with%20more%20sophisticated%20debugging%20options.
17:53:02
pjb
(macroexpand-1 '(declaim (optimize (speed 1)))) #| --> (progn (eval-when (:compile-toplevel) (ccl::compile-time-proclamation '((optimize (speed 1))) nil)) (eval-when (:load-toplevel :execute) (proclaim '(optimize (speed 1))))) ; t |#
17:53:56
jackdaniel
afair the implementation may treat declaim as file-local compilation declamation
17:54:10
jackdaniel
i.e after compiling the file the declaration does not stay in the global environment
17:55:23
pjb
So, one more reason not to use proclaim (even in an eval-when). You definitely don't want a compiled file to change your declarations…