~andreyorst

Moscow

https://andreyorst.gitlab.io/

I love Lisp and text editors!


#100 ,source REPL command 11 days ago

Comment by ~andreyorst on ~technomancy/fennel

Aug 9, 2024 01:41:11 ~technomancy outgoing@sr.ht:

I was imagining something that worked like clojure.repl/source; in other words something that would use its argument's metadata to open a file on disk and read the source based on the resolved file/line.

I see. Well, In that case I think it's still good to have this feature as a part of the REPL, since the language server is unofficial.

I wasn't proposing that the source for every function ever compiled be saved off in memory.

I wonder if this could be done, as it is more practical since the definition may change at runtime. IIRC there was a branch for source metadata?

#237 How to view infinity 27 days ago

Comment by ~andreyorst on ~technomancy/fennel

removed the math.acos use in the parser, and resent the patch, but the pipeline is failing with a weird error, not sure why.

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

Figured it out: https://lists.sr.ht/~technomancy/fennel/patches/54487

I am concerned by math.acos however. But there's no way to portably generate strictly positive nan or strictly negative nan as we can't check the sign. Or at least I couldn't find a way.

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

oh, it does seem that the parser doesn't recognize nan at all even if I add it as I did for inf. I don't get why.

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

NaN is even weirder. In PUC Lua 5.4 0/0 is -nan, math.abs(0/0) is nan, and -math.abs(0/0) is -nan again. In LuaJIT it is nan, and -math.abs(0/0) is nan again. In Fengari it's the same as LuaJIT, so no negative nan, except it is named NaN.

From https://github.com/gvx/Ser/issues/4

Under Windows, Lua 5.1.5 doesn't seem to generate NaNs, only indeterminates, but it distinguishes both with tostring:

C:\Lua>lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> print(to string(math.asin(2)))
-1.#IND
> print(tostring(0/0))
-1.#IND
> print(tostring(-(0/0)))
1.#QNAN
>

I'm not comparing strings, of course, but I kinda wonder how it should all work.

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

also, maybe we should also support NaN in the same way? Encoding is ridiculous though: (+ (/ 1 0) (/ -1 0)). Right now you can't read back nan from view.

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

~technomancy, WDYT should it be: &-inf or -&inf ? -&inf makes more sense, although it's a bit weird?

#237 How to view infinity 30 days ago

~andreyorst assigned ~andreyorst to #237 on ~technomancy/fennel

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

BTW, Fengari prints (/ 1 0) as Infinity. This bit probably has to be supported too. I'll send a patch along with implementation of this ticket

#237 How to view infinity 30 days ago

Comment by ~andreyorst on ~technomancy/fennel

&inf seems good to me, unless it would be confused with &rest for destructuring something like infinite data structures