!WTvnrBXAWIqKuxyqrR:matrix.org

Julia (lang)

314 Members
General help and discussion about the Julia language36 Servers

Load older messages


SenderMessageTime
29 Jun 2023
@hasnep:matrix.orgHannes * And if you do find a function that is only defined using a symbol then you can create an alias for it, I think the syntax would be something like this: const better_name = AnnoyingPackage.(:§) 09:51:56
@qwjyh:matrix.orgqwjyh
In reply to @headphonejack:matrix.org
What editor is recommended on Linux to be used with Julia beside VSCode/VSCodium? Which editor knows of for example the conversion from \div to the appropiate symbol?
I use neovim with hrsh7th/nvim-cmp and kdheepak/cmp-latex-symbols. julia-vim conflicts with other plugins in my environment :(
11:56:11
@qwjyh:matrix.orgqwjyhimage.png
Download image.png
11:57:50
@qwjyh:matrix.orgqwjyhThis article is helpful. https://dev.to/uncomfyhalomacro/the-must-have-neovim-plugins-for-julia-3j3m12:03:53
@headphonejack:matrix.orgheadphonejackOh thanks! Great stuff!17:33:23
@headphonejack:matrix.orgheadphonejack
In reply to @hasnep:matrix.org

Yeah, I believe in the stdlib all the special characters are just aliases for functions, e.g. the × symbol for cross products is just an alias for the cross function.

In theory a package could define a function that can only be accessed using a special symbol, but not everyone chooses to use these symbols, so every package I've seen that has special symbols also has a longer function name as well.

Is there a way to list all aliases and their related commands? Background: The Julia documentation for example uses for integer division the special character, which I cannot enter (yet). So I need to know the command, which get called. But it is only an example ... I need a complete list...
18:17:54
@headphonejack:matrix.orgheadphonejack left the room.18:33:01
30 Jun 2023
@hasnep:matrix.orgHannes
In reply to @headphonejack:matrix.org
Is there a way to list all aliases and their related commands? Background: The Julia documentation for example uses for integer division the special character, which I cannot enter (yet). So I need to know the command, which get called. But it is only an example ... I need a complete list...

You seem to have left the room so I don't know if you'll see this message, but there's no way to look up a complete list of symbols and their corresponding functions because the symbols are also functions, it just happens that we define them to be the same as other functions. E.g. you could do ÷(a::String, b::String) = a * b and define your own meaning for the ÷ symbol and then it wouldn't just be aliased to the div function.

The easiest way to look up a symbol is to use the Julia REPL, just type ? to enter help mode, then paste or type the symbol (by typing \div and then pressing tab) and then press enter. This shows a help page like this:

"÷" can be typed by \div<tab>

search: ÷

  div(x, y)
  ÷(x, y)
05:03:43
@hasnep:matrix.orgHannes
In reply to @headphonejack:matrix.org
Is there a way to list all aliases and their related commands? Background: The Julia documentation for example uses for integer division the special character, which I cannot enter (yet). So I need to know the command, which get called. But it is only an example ... I need a complete list...
*

You seem to have left the room so I don't know if you'll see this message, but there's no way to look up a complete list of symbols and their corresponding functions because the symbols are also functions, it just happens that we define them to be the same as other functions. E.g. you could do ÷(a::String, b::String) = a * b and define your own meaning for the ÷ symbol and then it wouldn't just be aliased to the div function.

The easiest way to look up a symbol is to use the Julia REPL, just type ? to enter help mode, then paste or type the symbol (by typing \div and then pressing tab) and then press enter. This shows a help page like this:

"÷" can be typed by \div<tab>

search: ÷

  div(x, y)
  ÷(x, y)

It carries on with more info about the div function, but the main part is where it lists the different ways to call this function.

05:04:33
@headphonejack:matrix.orgheadphonejack joined the room.17:28:07
@headphonejack:matrix.orgheadphonejack Sorry for leaving the room so suddenly...I had to go to work (and nearly forgot about it...:) On the neovim channel they show me a way to configure NeoVim to handle Julia code well. But (I think) the assumed a bare-bones NeoVim installation. I am using NVChad instead. Will see, how and whether I could configure that one. I would like to use Helix instead, because there is not that much configuration drama with that one (anyone using Helix editor for Julia here?)...But Helix (currenly) doesn't support these LaTeX->special symbol magic. So as it seems at the moment I need: An editor (Helix), code (obviously) and an other Julia REPL to cut'n'paste stuff back and forth with occasional "translation sessions"... 17:35:15
@qwjyh:matrix.orgqwjyhFYI, you can use IM(Input Methods) to type non ASCII characters everywhere. I've tried fcitx with fcitx-table-unicode-latex and fcitx5 with m17n(which includes latex ime), but none of them was fully compatible with Julia. Maybe you can make conversion table for the input method framework. And I sometimes use fcitx5's Unicode input feature which I can input arbitrary Unicode characters with hexadecimal code or character name.20:40:12
1 Jul 2023
@hasnep:matrix.orgHannes

To be honest, if you don't want to use these symbols you don't have to, I normally don't use them. and if you occasionally need to use one then copy-pasting from the repl isn't that bad, developing in Julia almost always involves having a repl open so it's only a small amount of friction.

If you're doing scientific programming with lots of Greek letters or specific operations that are traditionally written with specific mathematical symbols then I understand wanting to use the Unicode symbols for that, and copy pasting is not an acceptable solution then

02:04:48
@nappael:matrix.orgNappael changed their display name from Chris to Nappael.02:06:14
@wehandre:matrix.physik.uni-augsburg.deAndreas Weh
In reply to @qwjyh:matrix.org
I use neovim with hrsh7th/nvim-cmp and kdheepak/cmp-latex-symbols. julia-vim conflicts with other plugins in my environment :(
Correct me if I am wrong, but I think if you installed the language server, nvim-cmp also gives you the completions without cmp-latex-symbols.
06:13:42
@qwjyh:matrix.orgqwjyh
In reply to @wehandre:matrix.physik.uni-augsburg.de
Correct me if I am wrong, but I think if you installed the language server, nvim-cmp also gives you the completions without cmp-latex-symbols.
I tried it and I get completion without cmp-latex-symbols. But julia's language server starts up slow, so I'll keep cmp-latex-symbols in my config.
06:39:44
@hermitesch:matrix.orghermitesch joined the room.21:46:57
2 Jul 2023
@headphonejack:matrix.orgheadphonejackHow did you configure nvim-cmp to get these latex-symbols? 02:49:11
@osso33:matrix.orgosaut joined the room.07:06:43
@qwjyh:matrix.orgqwjyhadd kdheepak/cmp-latex-symbols as a completion source for nvim-cmp ``` require("nvim-cmp").setup({ ... sources = { .... { name = "latex_symbols", option = {strategy = 0}, .... }, .... }) ``` Described here: https://github.com/hrsh7th/nvim-cmp#recommended-configuration and here: https://github.com/kdheepak/cmp-latex-symbols#install09:46:43
@headphonejack:matrix.orgheadphonejackWHOW! Thanks a lot ! :)09:47:41
@qwjyh:matrix.orgqwjyhhttps://github.com/qwjyh/dotfiles/blob/main/dotfiles/neovim/init.lua Here's my init.lua09:49:14
@headphonejack:matrix.orgheadphonejackOne question: Since I am using NvChad, which seperates between NvChad-owned-configuration and that of the the user: WIll the syntax of your configuration add the settings to already existing settings for nvim-cmp (that is for my case those made by NvChad) or will it overwrite already existing settings? Or in other words: How can I add those settings to those already existing once...?11:55:40
@qwjyh:matrix.orgqwjyhI've never used NvChad. Maybe you should read NvChad docs. https://nvchad.com/docs/quickstart/install12:52:36
@headphonejack:matrix.orgheadphonejackThat's what I came from <sigh>....12:53:53
@qwjyh:matrix.orgqwjyhMaybe this one? https://nvchad.com/docs/config/walkthrough#custom_config12:54:57
@headphonejack:matrix.orgheadphonejack...I think (read: don't know for sure) the docs are a little outdated. The docs are talking about nvim-cmp, but trying to configure it gives the error message "unknown: nvim-vmp". I think I need to dig into it a little deeper as previously planned...<sigh>12:57:27
@headphonejack:matrix.orgheadphonejack * ...I think (read: don't know for sure) the docs are a little outdated. The docs are talking about nvim-cmp, but trying to configure it gives the error message "unknown: nvim-cmp". I think I need to dig into it a little deeper as previously planned...<sigh> 12:57:49
@qwjyh:matrix.orgqwjyh Maybe you did require'nvim-cmp' ? 13:04:24
@qwjyh:matrix.orgqwjyh Correct one is require('cmp') 13:06:15

Show newer messages


Back to Room ListRoom Version: