freenode/#lisp - IRC Chatlog
Search
16:22:04
beach
The description of TRACE in the SBCL manual mentions that "breakpoints" are used when :ENCAPSULATE is NIL. TRACE is can perform actions upon function entry and before function exit, and one possible action is to stop execution (break).
16:22:06
beach
But does anyone happen to know how these breakpoints work, and whether these breakpoints are available at other places in the code, and if so, how to set/clear them?
16:24:25
Nilby
I used things like sb-di:make-breakpoint sb-di:activate-breakpoint in my debugger. I don't really know how they work though.
16:34:21
beach
Sure. The stepper documentation mentions that it is "instrumentation based", and for stepping to be available, the DEBUG quality must be greater than all of speed, space, and compilation-speed.
16:35:54
beach
But there does not seem to be any documentation for sb-di:make-breakpoint etc., other than the docstrings.
16:40:29
Nilby
I probably should have documented what I discoverd about it, but I didn't feel qualified.
16:49:58
Nilby
Thankfully the code in debug-int.lisp has a lot of nice comments. I sometimes wish they were in the docstrings though.
16:50:07
beach
AHA, the comment in the stepper says it works differently. It says that the compiler inserts "STEP-CONDITION signalling [sic] forms into code compiled at high debug settings, and having a handler for them at the toplevel."
16:54:17
beach
Nilby: Not quite sure what you mean by that, but I think I have enough information for the "Previous work" section of my paper.
16:57:35
Nilby
karlosz: Right, but when you have a huge comment in the code, and no docstring in an external interface function, I wish they would have just copied a few lines into the docstring. I feel like old code didn't want to bloat memeory with docstrings.
17:00:05
karlosz
there's a feature called sb-doc that will even remove docstrings from standard library functions (and extensions etc.) because it will save memory in the core image
17:01:20
Nilby
I want the opposite function. Put all the docstrings back, even the ones that aren't there.
17:02:16
karlosz
i mean you need the source to understand the implementation anyway, i don't see why its advantageous ot have it in a docstring
17:04:45
karlosz
actually a lot of the implementation details are in a manual, rather than a docstring ;)
17:06:13
beach
There is an "internals" documentation, but it doesn't mention breakpoints as far as I can tell.
17:06:58
Nilby
Not understanding doesn't seem to stop me. Not knowing what of types arguemnts should be does though. Although I guess I could ask the compiler's type inference. :-)
17:07:57
pjb
Perhaps I could redo cl-stepper with this technique, it seems a lighter instrumentation.
17:08:14
karlosz
the real one is here: https://cmucl.org/docs/internals/design.html#Tracing-and-Breakpoints
17:10:38
karlosz
yep. for the next SBCL release i added a new section called "Advanced Compiler Use and Efficiency Hints" which says to read the CMUCL user manual because they describe how to optimize code for the compiler (which hasn't changed) in 100x more detail
17:11:18
karlosz
with a whopping 50 pages of optimization tricks and descriptions of how the compiler works
17:20:12
beach
Given that SBCL has these breakpoints, it is very surprising that no real source-level interactive debugger exists for SBCL. Unless of course, I am missing something obvious.
17:21:01
beach
I mean, SLIME could provide a key sequence to set a breakpoint in the code indicated by the editor point.
17:25:19
karlosz
i mean the functionality is all there. i don't think its the compilers job to deal with things like have source level interaction
17:25:34
karlosz
i think the reason there wasn't any in the compiler is because in CMUCL hemlock provided it
17:27:46
karlosz
unclear how to do source level interaction without an editor interface to the compiler
17:30:39
karlosz
speaking of CMUCL, the next release of SBCL will have whole program optimization a la CMUCL block-compilation
17:31:18
karlosz
so you can finally have your unboxed floating point calls and returns where you please
17:32:36
beach
Anyway, thanks for all the information. Time for me to go have dinner with my (admittedly small) family and then spend time with her.
17:44:42
asarch
With Postmodern, why don't: (query session :select "foo,bar" :from "baz" :where "id = 32424")?
17:45:47
asarch
We could even do: (query nasa-session ...) ... (query ibm-session ...) ... (query 4chan-session ...)
18:16:16
pfdietz
I don't think people realize the state of the compiler at the fork. It was not very mature.
18:17:20
karlosz
pfdietz: i will admit that i tend to have rose-colored lenses looking to the past. but the point on documentation and ease of reading the source still stands
18:18:51
SmallBrain
I've never written any code in my life before and figured "why not start with Lisp?" so I downloaded Portacle and read through the tutorial and at some point it said: "execute-extended-command has be rebound to the <execute> button" where is that?
18:20:12
pjb
SmallBrain: basically, it's an event loop that reads the next character, and looks up a table (key map) to find a function (command) to be executed.
18:20:21
pfdietz
My schtick is torturing lisp compilers until they confess. SBCL's compiler is quite resistant now. CMUCLs? It breaks almost immediately, even now.
18:20:39
pjb
SmallBrain: the nice thing is that you can configure this key map table at any time, during the execution of the program.
18:21:06
karlosz
pfdietz: yeah, from reading the source it seems that your bugs provoked a lot of backporting of sbcl fixes into cmucl by gerd
18:21:40
pjb
SmallBrain: if you have a key labelled <execute> on your keyboard, you can map the keycode of this key to the X11 key sym, and then you can map in emacs this keysym <execute> to some command, such as execute-extended-command.
18:22:06
karlosz
makes you wonder if it wasn't forked, given that people kept porting patches to and from CMUCL constantly until about 2004 when it became a ghost town there
18:22:10
pjb
SmallBrain: without such a key, it is customary, and the default, to use the key combination Meta-x (noted as M-x).
18:22:39
SmallBrain
pjb: ah, the problem is, I don't have that key and portacle has Meta-x rebound to something else
18:22:51
pjb
SmallBrain: the Meta keysym is usually mapped from a key labelled Meta, or if not present, a key labelled Command, Windows, or evne Alternate or Option.
18:23:05
karlosz
and, sometimes the patches when ported to cmucl would accrue improvements and those improvements wouldn't make it back
18:23:19
pjb
SmallBrain: the mesasge may be misleading, because the basic operation is adding a new key binding, not removing the old one.
18:24:01
pjb
SmallBrain: so M-x might still work. If not, the meta key is also mapped by emacs from ESC escape. But since ESC is not a modifier, you have to type it separately, first ESC, then x.
18:24:38
pjb
SmallBrain: you can also see where the execute-extended-command is bound, by typing C-h w execute-extended-command RET
18:24:58
SmallBrain
phoe: yes, I just downloaded it because it seemed less of a hassle than configuring everything myself
18:25:08
pjb
it will say you something in the minibuffer such as: execute-extended-command is on <execute>, <menu>, M-x
18:25:40
pjb
and inversely, you can know what command is bound to a key by typing C-h k followed by the key.
18:25:49
SmallBrain
pjb: i tried that and it literally said: "execute-extended-command is bound to the <execute> key"
18:26:33
SmallBrain
pjb: and google only gave me stockphotos of a return key where "execute" was written on it
18:26:50
Nilby
If you want you can probably type something like: <Esc> X global-set-key execute-extended-command <F1>
18:26:53
pjb
SmallBrain: go to the scratch buffer, and type: (global-set-key (kbd "M-x") 'execute-extended-command) C-x C-e
18:27:43
pjb
SmallBrain: you could also do that in the minibuffer with M-: (global-set-key (kbd "M-x") 'execute-extended-command) RET
18:28:21
pjb
Nilby: if the command execute-extended-command is only bound to <execute>, then ESC x is not bound to it, and won't do anything.
18:29:08
pjb
SmallBrain: yes, you can add a key binding with global-set-key, or with local-set-key when you want it only in the current buffer.
18:29:50
pjb
SmallBrain: you can have a bunch of global-set-key forms in your ~/.emacs to customize emacs as you wish.
18:30:54
Shinmera
Anyway, you don't need to read the Emacs tutorial. All the necessary terminology and keybindings are explained in the Portacle help buffer.
18:31:14
Shinmera
Due to portacle's customisation the emacs tutorial is more likely to be confusing than not
18:31:25
pjb
Shinmera: so perhaps portable should issue a message saying that "execute-extended-command has been rebound to the <execute> button" is not alarming because there's still a M-x working the same or better?
18:31:59
SmallBrain
Shinmera: I figured i couldn't hurt because i had never used any program like that
18:32:35
pjb
If you tell me that M-x doesn't work, it's very alarming to me, and I guess to any emacs user.
18:33:06
SmallBrain
pjb: the tutorial said too that M-x was rebound, I just couldn't find any "execute" key
18:33:09
phoe
or rather just mention that "if you want to use the vanilla emacs tutorial - be aware that it will not be useful, since Portacle was customized compared to the vanilla emacs and the tutorial won't cover that"
18:33:57
phoe
I can imagine a situation where someone downloads portacle, fires up the default tutorial, and gets stuck there because the tutorial doesn't apply to emacs
18:34:24
pjb
SmallBrain: so, the thing is that <execute> is the name of a virtual key (a keysym), not a physical key identified by a keycode.
18:35:00
pjb
SmallBrain: if you are on X, you can map some physical key you are not currently using, to the <execute> keysym, my editing a xmodmap file.
18:35:15
SmallBrain
I think the tutorial is fine as it is, it was probably just not written with the thought that someone as clueless as I could try it...
18:37:16
pjb
SmallBrain: for example, if the <Pause> keysym is mapped from the keycode 111, and you don't use it, you could map it to <execute> By replacing the line: keycode 111 = Pause Break by keycode 111 = Execute in ~/.xmodmap and reloading it with xmodmap ~/.xmodmap
18:37:59
pjb
SmallBrain: you could then scratch the Pause label and paint a new Execute label, or just erase all labels and remember them from key position (use a Das Keyboard blank keyboard or similar).
18:38:26
pjb
SmallBrain: Alternatively get yourself a SpaceCadet keyboard with all those funny key labels :-)
18:39:45
pjb
SmallBrain: but the thing is that with portable, execute-extended-command is not useful, since it's replaced by another command. Try: C-h k M-x to see which one. So you can just forget about the <execute> key.
18:40:04
phoe
I suggest that, if you want to go with the tutorial, you download the vanilla emacs and do the tutorial there
18:40:32
phoe
this way, you'll avoid the inspecting and rebinding mess that pjb is suggesting now, and you'll go straight to learning emacs instead.
18:40:49
phoe
since I don't think you want to learn how to turn portacle into vanilla emacs - you want to learn emacs instead
18:41:40
phoe
and I'll disagree, portacle is good enough when you don't want to invest your time and set up your own emacs installation for whatever reason and want to just hack some lisp.
18:41:49
SmallBrain
was it perhaps masochistic to try to learn programming with LISP as first language over all?
18:42:28
pjb
SmallBrain: no, it's really simple. But some people want to load a ton of pre-configured tools on newbies. This is not a good idea.
18:42:37
SmallBrain
I mean I want to learn Lisp, but most people suggested I start with Python or Javascript
18:42:49
pjb
SmallBrain: it's better to let you use your own editor, take a CL implementation, and run it in a terminal.
18:43:11
phoe
take into account language popularity though, python and JS are hundreds+ of times more popular than CL
18:43:34
phoe
it's possible to learn programming by doing Lisp, and there's one book that was written exactly for that reason
18:43:40
minion
SmallBrain: please look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
18:43:46
pjb
SmallBrain: after a week or so, you'll be fed up typing (load "my-source.lisp") in the REPL, so you'll be ready (ie. you will understand what and why) to use emacs and tools to integrate the editor with the CL implementation.
18:44:27
chimneys
SmallBrain: no just learn lisp in one hour that "gentle" tutorial is too big and rough, didn't waste time. In fact I am learning lisp from derek banas youtube tutoiral
18:45:31
pjb
SmallBrain: and similarly, emacs is very big so as a newbie, you could easily be overwhelmed. The thing with emacs is to start with the "bare" emacs, and to install and use emacs packages when you start feeling the need for them. Not pre-installing them, because then you won't understand what you did and why. And be prepared: you will never finish learning emacs, a lifetime wouldn't be enough!
18:47:00
phoe
SmallBrain: the way pjb is suggesting is actually the long one and AFAIK portacle attempts to be a shortcut for it. common lisp and emacs are pretty closely tied to each other by means of an IDE package called Slime.
18:47:37
phoe
and Slime is basically a requirement to utilize what's actually good about Lisp - the fact that it's an interactive and image-based language
18:48:11
phoe
image-based, meaning that you run Lisp once and then program by means of mutating that image
18:48:49
SmallBrain
phoe: I'l need more experience before I can accurately understand what that means
18:49:30
phoe
many other languages work by the means of writing your program in a text file, running it through a compiler, and executing the resulting program
18:51:04
phoe
and you program by changing these contents - for example, if you define some new functions, you add some new stuff to the Lisp image
18:51:23
phoe
if you tell Lisp that this previously defined function should instead do another thing, you modify stuff in the Lisp image
18:52:05
phoe
and you do all of this without ever turning it off - unless you screw something up so badly that a restart is required (;
18:52:29
phoe
that's why it's interactive - you converse with the Lisp image by telling it to add X or change Y or remove Z or run a piece of code
18:53:02
SmallBrain
without having to close the compiler, and rewriting everything in the text file and running it through the compiler again, only to find out that something is wrong
18:53:34
phoe
if you screwed up while writing a function, you only need to fix and recompile that function
18:54:36
SmallBrain
so does that mean the overall coding process is faster than with other languages?
18:55:44
dnaeon
hey folks, can someone please explain the following behaviour of `defpackage` when used along with Quicklisp and ASDF? https://gist.github.com/dnaeon/5018d1e5ebbc22a59f67a8e1b6a6ef35
18:56:25
phoe
the fact that Lisp can look into its own self pretty deeply is very fun - the debugger plus the inspector are a powerful combo
18:56:45
Xach
dnaeon: :USE and :IMPORT-FROM are about how you type symbol names and if they require prefixes or not
18:57:12
phoe
slime makes it possible to interactively inspect the stack and see the values of the local variables and the contents of these values and the contents of the contents of these values and so on.
18:57:47
pjb
SmallBrain: the emacs description I gave you above, where you can modify the keymap bindings in the program that is currently runing, actually it's based on an emacs lisp image-based development scheme. The idea is that you have a program, (a bunch of functions), and you can add, remove or replace functions while the program is running, as well as inspecting the data and of course modifying the data while the program is running.
18:58:11
pjb
SmallBrain: so when you program in an image-based system, you are actually modifying the running program.
18:58:56
SmallBrain
And that book that was linked further up, does it contain something like a list of possible formulas for Lisp-commands? or would that be a sisypho-task?
18:59:05
pjb
SmallBrain: of course, such a system doesn't only contain a compiler. At least, it will contain either an emacs (event loop -> key -> function), or a REPL = read eval print loop: (loop (print (eval (read)))).
18:59:59
pjb
SmallBrain: but you can have all kind of features implemented in an image based system, including an editor such as an emacs (which is the case for GNU emacs using emacs lisp, or for example Hemlock implemented in Common Lisp), and other applications.
19:00:03
phoe
SmallBrain: you usually don't need to get from the written text to a separate executable
19:00:25
Xach
executables are one thing that you can make but it isn't always the main thing like it is in other environments
19:00:36
dnaeon
Xach: phoe: in general that would mean that any dependency defined in my ASDF system will be available to my packages using the fully-qualified package path, and using `:USE` or `:IMPORT-FROM` within `defpackage` is more like a convenience, isn't it? e.g. whether you need just some symbols imported or inherit all of them from a given package?
19:00:39
SmallBrain
phoe: I was hoping for something like explanations for formulas like "if-then-else"
19:01:14
phoe
SmallBrain: that book contains explanations for such basics, and many other things in the language
19:01:15
pjb
SmallBrain: this is a question of delivering executable. Nowadays, we mix file-based development with image-based development, by editing files saved on the file system, outside of the image, and constantly being compiling and loading those files. We can do that because our computers have become very fast, so we can recompile and load interactively.
19:01:39
phoe
in many other languages, making executables is the only way to interact with the programs written in these languages
19:01:42
pjb
SmallBrain: so since the program is saved in files, once it's completed and debugged, we can use those files to generate an executable.
19:01:57
phoe
and your program can be invoked fully from the Lisp REPL, without ever needing to leave it
19:02:16
pjb
SmallBrain: it can be either by loading them in an image, and saving it as an executable image (most cl implementations do that), or compiling them and linking them (eg. with ecl).
19:02:49
pjb
SmallBrain: but you can also deliver lisp programs in other ways, eg. as sources, or as fasl file (ie. compiled files that can be loaded and run later).
19:05:11
SmallBrain
alright, I can't thank you all enough, I was about to give up since I had been sitting at this problem since yesterday
19:06:09
Xach
SmallBrain: i find it's a real help to ask people for help and get answers in real time.
19:07:13
[df]
one day we will all have our brains plugged in to one global lisp image running on a planet-sized supercomputer
19:08:52
phoe
SmallBrain: filed an issue at https://github.com/portacle/portacle/issues/130. Thanks for finding a bug in Portacle. (;
19:15:14
copec
There was a nice feeling about being able to end up with a little executable "back in the day"
19:16:22
[df]
it's nice but very non-essential, except perhaps for commercial products or tiny embedded systems
19:18:42
copec
I've been learning Rust, because I hate myself, so that's the only reason I even think about it
19:21:28
galdor
funny thing is, when you see people deploying 1+GB images containing trivial web apps, you stop caring about the size of a CL executable image
19:23:09
phoe
"why does your app bundle an operating system and ten versions of a trivial-left-pad package"
19:30:26
_death
HiRE: packages are named by strings.. you are talking about package designators, which may be symbols whose name is equal to the package's name
19:32:39
pjb
Well, any symbol read from #:foo will be garbage collected when memory is needed if it is not referenced somewhere.
19:33:06
Nilby
Unfortunately if there's one use of :package instead of #:package then it doesn't matter.
19:34:24
_death
if you use keywords, then there may be more ambiguities when autocompleting a keyword
19:35:23
pjb
HiRE: the most important job of intern, and the notion of internalizing things, is that when you read twice the same representation you get always the same object.
19:36:26
pjb
HiRE: so in (foo foo) we have actually two pointers to the same symbol foo. While in (#:foo #:foo) we have two pointers to two different homeless symbols named "FOO". While in (#1=#:foo #1#) we have two pointers to the same homeless symbol named "FOO".
19:36:33
phoe
http://index-of.es/Programming/Lisp/Lisp%20Mess/Erann%20Gat%20-%20Idiots%20Guide%20To%20Lisp%20Packages.pdf
19:39:11
pjb
HiRE: you can internalize other things, by implementing your own mapping. For example, cons cells. (defvar *conses* (make-hash-table :test 'equal)) (defun intern-cons (k) (or (gethash k *conses*) (setf (gethash k *conses*) k))) (setf *print-circle* t) (list (intern-cons (cons 1 2)) (intern-cons (cons 1 2)) (intern-cons (cons 3 4))) #| --> (#1=(1 . 2) #1# (3 . 4)) |#
19:40:30
pjb
HiRE: note: this is something that a compiler is autorized to do on any literal cons cell it finds in the compilation-unit.
19:43:36
White_Flame
HiRE: interning isn't a lisp-specific term, either. Many languages use it to describe unifying various equivalent objects into 1 instance.
19:45:06
Odin-
ACTION found it a little hilarious when he realised GNU Emacs is a tenth the size of "modern editors" that are basically attempts to remake it.
19:45:07
White_Flame
however, even if you delete-package, the actual symbol instances are still there, so as long as you're not READing any new strings with keywords, you might actually be okay?
19:46:33
Odin-
I still haven't seen a reference using that which doesn't have a clear link to Lisp usage, direct or indirect.
19:50:28
copec
Have you made it as a programmer when you make your own blog about making your own lisp?
19:51:33
dlowe
You've made it as a programmer when you make a thing and someone else uses it for something they want
19:55:56
copec
I swear I saw someone made a good illustration of the cl reader, and in searching for it came across many blogs about making a lisp
19:58:29
pjb
At the time, no other programming language had such a notion. In compilers, you had a symbol table, so you could have lookup_identifier or something, but no intern.
20:50:58
jackdaniel
I wrote rest api test automation that way (macros were more functionality oriented)
20:54:16
phadthai
other than handling HTTP, you may want to bind *debugger-hook* to handle conditions and use eval... also look at slime/swank that includes a third party implementation-independent REPL
21:16:23
reepca
is there a way to have a 'for' variable in a loop have an initial value and a stepping clause?
22:00:41
no-defun-allowed
That sounds great (and they almost didn't make any paren jokes), but that's steep.
22:02:06
pjb
copec: that's ok. Lispers have been programming in lisp for decades before loop was invented.
22:33:45
no-defun-allowed
TRIVIAL-SKI-COMBINATOR-CALCULUS: the ultimate TRIVIAL-UNTYPED-LAMBDA-CALCULUS
1:08:28
pjb
LdBeth: not harmful, but using to<-from instead of from->to might be better in lisp: (c<-b (b<-a a)) instead of (b->c (a->b a))
1:09:17
ebrasca
pjb: I need to implement wait-for-input-internal for usocket Mezzano implementation.
1:10:37
pjb
ebrasca: well -internal probably means that it's an internal function, so it can do anything, depending on the implementation of your code. wait-for-input should be clear enough: it should wait until something is ready to be read.
1:12:15
pjb
ebrasca: it should be noted that you get no help from CL for this kind of features. There's a LISTEN function for character streams, but since it's always implementation and platform dependent if and how streams are buffered, LISTEN doesn't give much information. It does precisely what it's specified to do, indicate whether there's data ready to be processed for lisp. But more data could have been available if the things had bee
1:12:17
LdBeth
pjb: I mean thinking in coercion while asking for formatting is no good. There could have many functions have type number->string
1:14:41
pjb
LdBeth: scheme number->string doesn't have the type number -> string: it can signal errors…
1:17:32
pjb
Note how C++ or Java function signatures include the set of conditions that are signaled. int foo(int x) throws Y,Z;
1:21:06
LdBeth
pjb: partial in the sense that not all elements in the set of input type are covered. However you can still view conditions/errors/exceptions as objects of certain type
1:22:01
_death
C++ has exception specifications, but nobody uses them because they have issues.. except maybe to say that a function does not throw
1:22:09
LdBeth
A partial function in domain A could be a total on in domain B which is a subset of A
1:25:40
_death
dlowe: well, I wanted to say that I haven't used it for a while, but then I recalled that I used it today.. to add a bit of texture manipulation functions to my imgui+ecl thingy so that I can use vecto to draw stuff and see it appear immediately on screen :)
1:26:09
dlowe
"If an exception is thrown from a function that has not specified the thrown exception in its exception specification, the result is a call to the function unexpected()."
1:28:22
_death
I could've just used cl-opengl for that bit, but I didn't want to depend on it for such basic functionality so provided my own interface
1:29:50
Xach
_death: i am on the verge of making something that uses the vecto api but draws into a browser immediately instead. i need faster feedback.
1:30:38
Xach
dlowe: i was thinking a websocket where lisp pushes primitives to a little js kernel that draws to a canvas. but it's all thinking so far, no doing.
1:31:44
Xach
bidirectional, too, so i could send mouse events to lisp and react. again, mostly daydreaming without code so far.
1:33:35
Xach
this seems legit easier than porting my preferred way of messing around with graphic objects to javascript
1:34:11
smokeink
Xach: I think it's very doable; I've done it with trident mode but I want to switch to using websockets ;
1:45:42
_death
Xach: the color changes every time I C-M-x.. I didn't measure how much time it takes to render though
1:49:27
_death
you could do something like that with simple cl-opengl code.. likely easier than websockets+js :)
1:55:14
Xach
_death: i'd like to cut down the feedback loop of thinking about a tweak to a graphics hack and seeing what it looks like. i'd also like to add some interactivity.
1:59:25
Xach
https://i.imgur.com/mgXMaMY.png would be fun to make all the "rays" point at the cursor
2:10:05
Bike
those are escape characters. They mean that that all the characters in the name are exactly those characters, and not downcased or anything.
2:36:10
loke
Speaking of lispmemes... Where does this come from? https://www.reddit.com/r/LispMemes/comments/ciw99r/heres_a_better_way_to_macro/
2:37:01
loke
There must be some story to this, because no sane person would write code like that. Ever.
3:33:14
smokeink
(let () (defvar x0 2) x0) ; why does it give a Warning: this undefined variable: X0 ? (when evaling it the 1st time) and this one doesn't?: (progn (defvar x6 2) x6)
3:34:57
pjb
smokeink: The second form could also give a warning when evaluating it the first time. If it doesn't, it may show that you evalulate it in a REPL that uses an optimization for progn forms.
3:35:38
pjb
smokeink: in both cases, defvar doesn't do anything until the form is evaluated: it has no compilation-time effect. Therefore when both forms are compiled, at compilation time, there is no variable known by x0 or x6.
3:36:57
pjb
smokeink: once you evaluate them, the symbol x0 (or x6) is marked as being special, a dynamic binding is established between the symbol and the initial value, and all the code that was compiled using lexical binding of variables named x0 (or x6) are still lexical bindings. So basically, your defvar forms are useless.
3:37:55
pjb
smokeink: in which case, since you have a different environment between the old code already compiled, and the new code, you can get semantic discrepancies, and strange bugs.
3:39:12
pjb
Therefore 1- never use defvar or defparameter other than as toplevel form (note progn keeps it a toplevel form, so what I called optimization above must actually be the specified semantic).
3:41:36
pjb
smokeink: (defvar *x0* 2) (let () *x0*) #| --> 2 |# (progn (defvar *x6* 2) *x6*) #| --> 2 |#
3:43:58
pjb
China releases its own programming language Mulan <https://cntechpost.com/2020/01/17/china-releases-its-own-programming-language-mulan/>
3:48:37
smokeink
if they don't use Chinese characters, I wouldn't call it very Chinese https://img2018.cnblogs.com/i-beta/989505/202001/989505-20200117111140494-1123911009.png
3:48:44
no-defun-allowed
pjb: I cannot find any information on the language other than news, and how is it related to Lisp?
3:50:40
no-defun-allowed
"elastic actor execution model" sounds interesting, but it sounds difficult to put with "C" and embedded devices.
3:53:38
LdBeth
no-defun-allowed: according to some Chinese user, it’s currently like a cut down version of Python
4:03:37
smokeink
pjb: here's some Common Lisp https://paste.ofcode.org/Wnu3ffzKvnwf3ZM3M8cibA in Classical Chinese . the advantage is having short identifiers - if you're used to the logograms -
4:04:45
pjb
smokeink: and the advantage, is that since it's lisp code, ie. lisp data, we can easily write a little function to substitute the chinese ideogram with words using the latin alphabet. :-)
4:07:49
smokeink
you could, but that would be at the end when you want to share the code with others ; during development you can keep it short