installed by manually checking out from git and worked. I think must be something with the AUR build file the package manager is using. aybe it's an older one.
I'm not doing anything special. I open the package manager, type unicon and click "build". It's just using whatever config the package maintainer created,
Jafar, I'm on Manjaro. I'm installing uaing the pacman package manager. Unfortunately I don't get a unicon-config.log. Unless this is what it is: Preparing... Cloning unicon build files... Checking unicon dependencies... Resolving dependencies... Checking inter-conflicts... Building unicon... ==> Making package: unicon latest-2 (Wed 02 Dec 2020 11:15:39 AM) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... ==> Removing existing $srcdir/ directory......
Having some issues installing through the arch package manager. It builds for a while but then stops with: /usr/bin/ld: ../../bin/libucommon.a(filepart.o):(.bss+0x8): multiple definition of `flog'; xrwindow.o:(.bss+0x60a8): first defined here collect2: error: ld returned 1 exit status make[3]: [Makefile:47: iconx] Error 1 make[3]: Leaving directory '/var/tmp/pamac-build-drifter/unicon/src/unicon-code/unicon/src/runtime' make[2]: [Makefile:39: interp_all] Error 2 make[2]: Leaving directory '/var/tmp/pamac-build-drifter/unicon/src/unicon-code/unicon/src/runtime'...
Another item on the wishlist would be of course native support for unicode text. Ive seen previous posts on the subject however not sure if additional work was planned. User defined operators would also be great, but not a priority.
Clint, The difference is simply that it allows to express things in sequence, in the order things should be done. For example a recipe: Step 1 Step 2 Step 3 ex: procedure make_pie(apples) apples -> chop -> bake -> serve end Vs: procedure make_pie(apples) serve(bake(chop(apples))) end Typically the output of the previous procedure serves as implicit input to the next without having to specify it. for example lets say the procedures above have the following signatures: procedure chop(ingredient) ......
Changes to the language: 1. Multiline comments would be great! 2. A "pipe" operator to sequentially to pass the return value of a procedure to another like in Standar ML, Haskell etc.. ex: filtered_list := some_data |> some_procedure |> some_other_procedure(param_2) procedure some_procedure(param) ... return result end procedure some_other_procedure(param_1, param_2) #when using the pipe operator the return value of the previous procedure is fed as the first param of the next proc ... return result...
Jafar, uncon -c did the trick! That was the issue.
Jafar, yes correct, all my files are in the same directory. First I did: unicon String.icn followed by: packagetest.icn and get the following: D:\Dev\Unicon>unicon String.icn Parsing String.icn: String.icn is already in Package string ..split is already in Package string d:\apps\Unicon\bin\icont.exe -c -O String.icn C:\Users\NV7547\AppData\Local\Temp\uni13967197 Translating: String.icn: string__split No errors d:\apps\Unicon\bin\icont.exe String.u Linking: D:\Dev\Unicon>unicon packagetest.icn Parsing...
Hello, Would it be possible to share abit more on how to properly create and use packages? For example I have created a file String.icn with package definition: package String procedure split(s) return if marker := find(" ", s) then { [s[1:marker]] ||| split(s[marker+1:0]) } else { [s] } end What are the steps to import this into a program? I have compiled it first, then compiled my main program which has: import String However I get an error that the package doesnt exist. Any tips would be great....
If one were to process some text, for example, a book which has a combination of natural language and programming language, for example a programming language book, which would be your preferred approach to recognize and distinguish source code from regular text? A lexer/parser Write scanner/parser for the programming language, using the usual approach to tokenizing, identifying tokens etc... and assume that anything that cant be recognized is regular text. String scanning Pattern matching Use pattern...
Has anyone considered any use cases for Unicon in the world of AI and Machine Learning? I'm only getting to know mre about Machine Learning, but if I understand, this gist of it is: Defining and identifying patterns (in text, data etc...) I think this is called "defining a model" in ML parlance. Having a program "train" itself on a large dataset against a model (#1) (setting goals and learning what is a failure and what is a success) Most of the popular frameworks for doing machine learning out there...
haha oops...these: https://github.com/cloutiy/unicon-lang/tree/master/sublime
Copy the following files https://github.com/cloutiy/unicon-lang/tree/master/sublime to: ~/.config/sublime-text-3/Packages/User What you get: case expression snippet: c (then press tab) every expression snippet: e (then press tab) if expression snippet: i (then press tab) procedure snippet: p (then press tab) record snippet: rec (then press tab) string scan snippet: ? (then press tab) until expression snippet: u (then press tab) while expression snippet: w (then press tab) For those snippets that...
Copy the following files to: ~/.config/sublime-text-3/Packages/User What you get: case expression snippet: c (then press tab) every expression snippet: e (then press tab) if expression snippet: i (then press tab) procedure snippet: p (then press tab) record snippet: rec (then press tab) string scan snippet: ? (then press tab) until expression snippet: u (then press tab) while expression snippet: w (then press tab) For those snippets that have placeholders, pressing tab will cycle through them , taking...
Copy the following files to: ~/.config/sublime-text-3/Packages/User What you get: case expression snippet: c (then press tab) every expression snippet: e (then press tab) if expression snippet: i (then press tab) procedure snippet: p (then press tab) record snippet: rec (then press tab) string scan snippet: ? (then press tab) until expression snippet: u (then press tab) while expression snippet: w (then press tab) Still learning how to configue sublime...I'm sure there are better ways to package...
Copy the following files to: ~/.config/sublime-text-3/Packages/User What you get: case expression snippet: c (then press tab) every expression snippet: e (then press tab) if expression snippet: i (then press tab) procedure snippet: p (then press tab) record snippet: rec (then press tab) string scan snippet: ? (then press tab) until expression snippet: u (then press tab) while expression snippet: w (then press tab) Still learning how to configue sublime...I'm sure there are better ways to package...
Copy the following files to: ~/.config/sublime-text-3/Packages/User What you get: case expression snippet: c (then press tab) every expression snippet: e (then press tab) if expression snippet: i (then press tab) procedure snippet: p (then press tab) record snippet: rec (then press tab) string scan snippet: ? (then press tab) until expression snippet: u (then press tab) while expression snippet: w (then press tab) Still learning how to configue sublime...I'm sure there are better ways to package...
@Clint thanks for pointing out the lang lib. I had no idea of it, but found it very useful to browse at the code in there. Actually, I spent a bit more time poking around to look at the other folders too. Perhaps this is another topic, but is there documentation that exists to browse the available modules and their contents, kind of like this? https://crystal-lang.org/api/0.27.2/ @jafar + @bruce I will let the experts handle this one, In certainly had not thought about the case where the same class...
I know of the existence of the type function. This function works fine for basic types. But when I use it on instances of a class, I get something like: MyClass__state I created this nifty wrapper around the type function. If the parameter is an instance of a clasee, it will return the class name, and if it's not an instance of a class, will just return "integer", "string", "list" etc... procedure typeof(thing) return ( t := type(thing) ? tab(upto("_")) | type(thing) ) end This was awesome, until...
Hi Jafar, Attached is the file for sublime text 3. I'm not an expert but what I know is that this file needs to be added into: ~/.config/sublime-text-3/Packages/User/ Then I think the editor should be able to recognize when a .icn file is open and apply the syntax highlighting.
I added the rest of the reserved words using Brian's docs as a reference. How can I contribute the file?
Hi there, I'd like to know if it's possible to know the position of where a subject ?? pattern failed? I'm experimenting with an idea. Doing lexical analysis using string scanning Doing syntax analysis with SNOBOL patterns. The trick I'm trying is instead of integers for token IDs, I'm using characters. As tokens are recognized, I append its ID (a char) to a string. The result will be kind of like a DNA sequence - a pattern of tokens. In addition, I'm keeping a list of token records, which has the...
Nvermind, after looking at Brian's documentation, I see records need to be defined outside of main() # record initializers are in the global name space record sample(field1, field2, field3)
Hi there, I'm trying to declare a record but am getting 2 errors: elipses.icn:54: # "record" missing semicolon or operator elipses.icn:55: # "record" unclosed parenthesis Line 54 and 57 are identified below. But if I comment out [54], the error for [57] goes away. line := 1 column := 1 tokenPattern := "" tokenList := [] [54] record Token(kind, value, line, column) [57] while *text > 0 do { As far as I can tell I'm following the correct syntax for records. I have looked at both the Unicon and Icon...
Great, thanks for looking into it Clint
Hi Bruce, After some fiddling around I managed to clear the error by adding parens to my regular expression: <(.)+> instead of (<.+>) It's working to some degree, but I'm not getting the results I has hoping. I will need to have anther look at the html source and reassess my aproach. The html is not as clean as I initially thought.
Hi again, When trying to match a simple pattern: title := "<TITLE>" || (<.+>) -> capture || "</TITLE>" if text ?? title then write("\\chapter{", capture, "}") I get the following error: "pattern_assign_onmatch": invalid argument for unary operator which references this line: title := "<TITLE>" || (<.+>) -> capture || "</TITLE>" What I'm trying t do is assign anything in between <TITLE> and </TITLE> to a variable. To my knowledge I seem to be following the correct syntax, but it seems not!
Hi again, When trying to match a simple pattern: title := "<TITLE>" || (<.+>) -> capture || "</TITLE>" if text ?? title then write("\\chapter{", capture, "}") I get the following error: "pattern_assign_onmatch": invalid argument for unary operator which references this line: title := "<TITLE>" || (<.+>) -> capture || "</TITLE>" What I'm trying t do is assign anything in between <TITLE> and </TITLE> to a variable. To my knowledge I seem to be following the correct syntax, but it seems not!
Hi there, I would like some advice on the best way to tackle a programming task. I have a bunch of .htm pages that I want to convert into LaTex. All of them seem to follow the same structure, so essentially what I'd like to do is: Look for patterns that I want to keep and do something with them. Some examples: a. transform <TITLE>A title</TITLE> to \chapter{A Title} b. tranform <I>Italic text</I> to \em{Italic text} c. transform <P>Some text</P> to Some text[newline] In reality the <P> tags will...
Hi group, I'd like to know if anyone is aware of a "static website generator" built with Unicon? Regards,
Does anyone here use Udemy? I've used it to learn other languages like F#, I've also used Coursera for OCaml and others. Would be interesting to see some courses, instructional videos or tutorials on Unicon. On Udemy courses are usually well priced and not very prohibitive. It could be a medium to help give visibility. Plus whoever puts the courses up could make a couple bucks and passive income from it. Just a thought
Jafar, $define foreach every is what I was trying to achieve. Thanks for the tip! Pretty cool to be able to use aliases. I added the following for more sugar ;) $define in := $define foreach every foreach x in !"abcdefgh" do { write(x) }
Jafar, $define foreach every is what I was trying to achieve. Thanks for the tip!
Hello, I'm playing around with assigning proc values to variables but not sure what I'm doing wrong. In the code below I get the following error: test.icn:11: # "x" unclosed literal or missing operator Seems my assignment to "foreach" doesn't work, whereas the one for "collect" does. I can't spot the difference. procedure main() local x foreach := every collect := tab "123456abcde" ? { x := collect(many(&digits)) } write(x) foreach x := !"abcdefgh" do { write(x) } return end
Hi folks, I'm going through a book I just received called "Programing Language Concepts:...
@Bruce: Your experiments with parsers seem interesting! Please do share once you...
One of my interests is...programming languages and how they are implemented. In most...
Thanks everyone. I have to agree, the unicon folks are a friendly bunch, as are the...
Hi everyone, I'm a hobby programmer in Ottawa, Canada. Well, I graduated from CompSci...
Hi everyone, I'm a hobby programmerin Ottawa, Canada. Well, I graduated from CompSci...
Hi everyone, I'm a hobby programming in Ottawa, Canada. Well, I graduated from CompSci...